mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-29 07:18:58 +01:00
test: use f-strings in feature_notifications.py
This commit is contained in:
@@ -20,7 +20,7 @@ FILE_CHARS_DISALLOWED = '/\\?%*:|"<>' if os.name == 'nt' else '/'
|
|||||||
UNCONFIRMED_HASH_STRING = 'unconfirmed'
|
UNCONFIRMED_HASH_STRING = 'unconfirmed'
|
||||||
|
|
||||||
def notify_outputname(walletname, txid):
|
def notify_outputname(walletname, txid):
|
||||||
return txid if os.name == 'nt' else '{}_{}'.format(walletname, txid)
|
return txid if os.name == 'nt' else f'{walletname}_{txid}'
|
||||||
|
|
||||||
|
|
||||||
class NotificationsTest(BitcoinTestFramework):
|
class NotificationsTest(BitcoinTestFramework):
|
||||||
@@ -39,11 +39,11 @@ class NotificationsTest(BitcoinTestFramework):
|
|||||||
|
|
||||||
# -alertnotify and -blocknotify on node0, walletnotify on node1
|
# -alertnotify and -blocknotify on node0, walletnotify on node1
|
||||||
self.extra_args = [[
|
self.extra_args = [[
|
||||||
"-alertnotify=echo > {}".format(os.path.join(self.alertnotify_dir, '%s')),
|
f"-alertnotify=echo > {os.path.join(self.alertnotify_dir, '%s')}",
|
||||||
"-blocknotify=echo > {}".format(os.path.join(self.blocknotify_dir, '%s')),
|
f"-blocknotify=echo > {os.path.join(self.blocknotify_dir, '%s')}",
|
||||||
], [
|
], [
|
||||||
"-rescan",
|
"-rescan",
|
||||||
"-walletnotify=echo %h_%b > {}".format(os.path.join(self.walletnotify_dir, notify_outputname('%w', '%s'))),
|
f"-walletnotify=echo %h_%b > {os.path.join(self.walletnotify_dir, notify_outputname('%w', '%s'))}",
|
||||||
]]
|
]]
|
||||||
self.wallet_names = [self.default_wallet_name, self.wallet]
|
self.wallet_names = [self.default_wallet_name, self.wallet]
|
||||||
super().setup_network()
|
super().setup_network()
|
||||||
@@ -54,12 +54,12 @@ class NotificationsTest(BitcoinTestFramework):
|
|||||||
seed = "cTdGmKFWpbvpKQ7ejrdzqYT2hhjyb3GPHnLAK7wdi5Em67YLwSm9"
|
seed = "cTdGmKFWpbvpKQ7ejrdzqYT2hhjyb3GPHnLAK7wdi5Em67YLwSm9"
|
||||||
xpriv = "tprv8ZgxMBicQKsPfHCsTwkiM1KT56RXbGGTqvc2hgqzycpwbHqqpcajQeMRZoBD35kW4RtyCemu6j34Ku5DEspmgjKdt2qe4SvRch5Kk8B8A2v"
|
xpriv = "tprv8ZgxMBicQKsPfHCsTwkiM1KT56RXbGGTqvc2hgqzycpwbHqqpcajQeMRZoBD35kW4RtyCemu6j34Ku5DEspmgjKdt2qe4SvRch5Kk8B8A2v"
|
||||||
desc_imports = [{
|
desc_imports = [{
|
||||||
"desc": descsum_create("wpkh(" + xpriv + "/0/*)"),
|
"desc": descsum_create(f"wpkh({xpriv}/0/*)"),
|
||||||
"timestamp": 0,
|
"timestamp": 0,
|
||||||
"active": True,
|
"active": True,
|
||||||
"keypool": True,
|
"keypool": True,
|
||||||
},{
|
},{
|
||||||
"desc": descsum_create("wpkh(" + xpriv + "/1/*)"),
|
"desc": descsum_create(f"wpkh({xpriv}/1/*)"),
|
||||||
"timestamp": 0,
|
"timestamp": 0,
|
||||||
"active": True,
|
"active": True,
|
||||||
"keypool": True,
|
"keypool": True,
|
||||||
|
|||||||
Reference in New Issue
Block a user