mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 11:32:46 +01:00
Merge bitcoin/bitcoin#23316: test: make the node param explicit in init_wallet()
7b3c9e4ee8feb552dc0fc4347db2d06e60894a9f Make explicit the node param in init_wallet() (lsilva01) Pull request description: This PR changes the definition of `def init_wallet(self, i)` to `def init_wallet(self, *, node)` to make the node parameter explicit, as suggested in https://github.com/bitcoin/bitcoin/pull/22794#discussion_r713287448 . ACKs for top commit: stratospher: tested ACK 7b3c9e4. Tree-SHA512: 2ef036f4c2110b2f7dc893dc6eea8faa0a18edd7f8f59b25460a6c544df7238175ddd6a0d766e2bb206326b1c9afc84238c75613a0f01eeda89a8ccb7d86a4f1
This commit is contained in:
parent
995cae46af
commit
66e77f7879
@ -49,7 +49,7 @@ class InvalidAddressErrorMessageTest(BitcoinTestFramework):
|
|||||||
self.test_validateaddress()
|
self.test_validateaddress()
|
||||||
|
|
||||||
if self.is_wallet_compiled():
|
if self.is_wallet_compiled():
|
||||||
self.init_wallet(0)
|
self.init_wallet(node=0)
|
||||||
self.test_getaddressinfo()
|
self.test_getaddressinfo()
|
||||||
|
|
||||||
|
|
||||||
|
@ -469,12 +469,12 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
|||||||
|
|
||||||
def import_deterministic_coinbase_privkeys(self):
|
def import_deterministic_coinbase_privkeys(self):
|
||||||
for i in range(len(self.nodes)):
|
for i in range(len(self.nodes)):
|
||||||
self.init_wallet(i)
|
self.init_wallet(node=i)
|
||||||
|
|
||||||
def init_wallet(self, i):
|
def init_wallet(self, *, node):
|
||||||
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
|
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:
|
if wallet_name is not False:
|
||||||
n = self.nodes[i]
|
n = self.nodes[node]
|
||||||
if wallet_name is not None:
|
if wallet_name is not None:
|
||||||
n.createwallet(wallet_name=wallet_name, descriptors=self.options.descriptors, load_on_startup=True)
|
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', rescan=True)
|
n.importprivkey(privkey=n.get_deterministic_priv_key().key, label='coinbase', rescan=True)
|
||||||
|
@ -135,9 +135,9 @@ class WalletBackupTest(BitcoinTestFramework):
|
|||||||
assert os.path.exists(wallet_file)
|
assert os.path.exists(wallet_file)
|
||||||
|
|
||||||
def init_three(self):
|
def init_three(self):
|
||||||
self.init_wallet(0)
|
self.init_wallet(node=0)
|
||||||
self.init_wallet(1)
|
self.init_wallet(node=1)
|
||||||
self.init_wallet(2)
|
self.init_wallet(node=2)
|
||||||
|
|
||||||
def run_test(self):
|
def run_test(self):
|
||||||
self.log.info("Generating initial blockchain")
|
self.log.info("Generating initial blockchain")
|
||||||
|
@ -23,7 +23,7 @@ class ListDescriptorsTest(BitcoinTestFramework):
|
|||||||
self.skip_if_no_sqlite()
|
self.skip_if_no_sqlite()
|
||||||
|
|
||||||
# do not create any wallet by default
|
# do not create any wallet by default
|
||||||
def init_wallet(self, i):
|
def init_wallet(self, *, node):
|
||||||
return
|
return
|
||||||
|
|
||||||
def run_test(self):
|
def run_test(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user