diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-10-20 17:43:51 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-10-20 17:44:01 +0200 |
commit | 1435161f641903589210b616f9098ba9130b3e57 (patch) | |
tree | 7010dd945437cee517e6dfd357c1f48bcab4bcfa | |
parent | d807aceeabf4200e9fc4f367714bea5e4c0f5deb (diff) | |
parent | 7b3c9e4ee8feb552dc0fc4347db2d06e60894a9f (diff) |
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
-rwxr-xr-x | test/functional/feature_rbf.py | 2 | ||||
-rwxr-xr-x | test/functional/rpc_invalid_address_message.py | 2 | ||||
-rwxr-xr-x | test/functional/test_framework/test_framework.py | 8 | ||||
-rwxr-xr-x | test/functional/wallet_backup.py | 6 | ||||
-rwxr-xr-x | test/functional/wallet_listdescriptors.py | 2 | ||||
-rwxr-xr-x | test/functional/wallet_taproot.py | 2 |
6 files changed, 11 insertions, 11 deletions
diff --git a/test/functional/feature_rbf.py b/test/functional/feature_rbf.py index 4eaaf46454..420147542e 100755 --- a/test/functional/feature_rbf.py +++ b/test/functional/feature_rbf.py @@ -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}) diff --git a/test/functional/rpc_invalid_address_message.py b/test/functional/rpc_invalid_address_message.py index 7ab5a5e90d..085f6582b5 100755 --- a/test/functional/rpc_invalid_address_message.py +++ b/test/functional/rpc_invalid_address_message.py @@ -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() diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index 727ac6aed9..ec3561b1f2 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -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') diff --git a/test/functional/wallet_backup.py b/test/functional/wallet_backup.py index bc6d6206e5..a07c28c8a4 100755 --- a/test/functional/wallet_backup.py +++ b/test/functional/wallet_backup.py @@ -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") diff --git a/test/functional/wallet_listdescriptors.py b/test/functional/wallet_listdescriptors.py index 221f5262d9..436bbdcfcc 100755 --- a/test/functional/wallet_listdescriptors.py +++ b/test/functional/wallet_listdescriptors.py @@ -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): diff --git a/test/functional/wallet_taproot.py b/test/functional/wallet_taproot.py index 4f84dbd125..80c125df97 100755 --- a/test/functional/wallet_taproot.py +++ b/test/functional/wallet_taproot.py @@ -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 |