mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 11:57:28 -03:00
Make explicit the node param in init_wallet()
This commit is contained in:
parent
23a7d56df2
commit
7b3c9e4ee8
6 changed files with 11 additions and 11 deletions
|
@ -539,7 +539,7 @@ class ReplaceByFeeTest(BitcoinTestFramework):
|
|||
assert_equal(json1["vin"][0]["sequence"], 4294967295)
|
||||
|
||||
if self.is_wallet_compiled():
|
||||
self.init_wallet(0)
|
||||
self.init_wallet(node=0)
|
||||
rawtx2 = self.nodes[0].createrawtransaction([], outs)
|
||||
frawtx2a = self.nodes[0].fundrawtransaction(rawtx2, {"replaceable": True})
|
||||
frawtx2b = self.nodes[0].fundrawtransaction(rawtx2, {"replaceable": False})
|
||||
|
|
|
@ -90,7 +90,7 @@ class InvalidAddressErrorMessageTest(BitcoinTestFramework):
|
|||
self.test_validateaddress()
|
||||
|
||||
if self.is_wallet_compiled():
|
||||
self.init_wallet(0)
|
||||
self.init_wallet(node=0)
|
||||
self.test_getaddressinfo()
|
||||
|
||||
|
||||
|
|
|
@ -423,12 +423,12 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
|||
|
||||
def import_deterministic_coinbase_privkeys(self):
|
||||
for i in range(self.num_nodes):
|
||||
self.init_wallet(i)
|
||||
self.init_wallet(node=i)
|
||||
|
||||
def init_wallet(self, i):
|
||||
wallet_name = self.default_wallet_name if self.wallet_names is None else self.wallet_names[i] if i < len(self.wallet_names) else False
|
||||
def init_wallet(self, *, node):
|
||||
wallet_name = self.default_wallet_name if self.wallet_names is None else self.wallet_names[node] if node < len(self.wallet_names) else False
|
||||
if wallet_name is not False:
|
||||
n = self.nodes[i]
|
||||
n = self.nodes[node]
|
||||
if wallet_name is not None:
|
||||
n.createwallet(wallet_name=wallet_name, descriptors=self.options.descriptors, load_on_startup=True)
|
||||
n.importprivkey(privkey=n.get_deterministic_priv_key().key, label='coinbase')
|
||||
|
|
|
@ -124,9 +124,9 @@ class WalletBackupTest(BitcoinTestFramework):
|
|||
assert_raises_rpc_error(-8, "Wallet name already exists.", node.restorewallet, wallet_name, wallet_file)
|
||||
|
||||
def init_three(self):
|
||||
self.init_wallet(0)
|
||||
self.init_wallet(1)
|
||||
self.init_wallet(2)
|
||||
self.init_wallet(node=0)
|
||||
self.init_wallet(node=1)
|
||||
self.init_wallet(node=2)
|
||||
|
||||
def run_test(self):
|
||||
self.log.info("Generating initial blockchain")
|
||||
|
|
|
@ -23,7 +23,7 @@ class ListDescriptorsTest(BitcoinTestFramework):
|
|||
self.skip_if_no_sqlite()
|
||||
|
||||
# do not create any wallet by default
|
||||
def init_wallet(self, i):
|
||||
def init_wallet(self, *, node):
|
||||
return
|
||||
|
||||
def run_test(self):
|
||||
|
|
|
@ -185,7 +185,7 @@ class WalletTaprootTest(BitcoinTestFramework):
|
|||
def setup_network(self):
|
||||
self.setup_nodes()
|
||||
|
||||
def init_wallet(self, i):
|
||||
def init_wallet(self, *, node):
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
|
|
Loading…
Reference in a new issue