Skip to content

Commit

Permalink
Merge bitcoin#23316: test: make the node param explicit in init_wallet()
Browse files Browse the repository at this point in the history
7b3c9e4 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 bitcoin#22794 (comment) .

ACKs for top commit:
  stratospher:
    tested ACK 7b3c9e4.

Tree-SHA512: 2ef036f4c2110b2f7dc893dc6eea8faa0a18edd7f8f59b25460a6c544df7238175ddd6a0d766e2bb206326b1c9afc84238c75613a0f01eeda89a8ccb7d86a4f1
  • Loading branch information
MarcoFalke authored and vijaydasmp committed Dec 5, 2024
1 parent 995cae4 commit 66e77f7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion test/functional/rpc_invalid_address_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def run_test(self):
self.test_validateaddress()

if self.is_wallet_compiled():
self.init_wallet(0)
self.init_wallet(node=0)
self.test_getaddressinfo()


Expand Down
8 changes: 4 additions & 4 deletions test/functional/test_framework/test_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,12 +469,12 @@ def setup_nodes(self):

def import_deterministic_coinbase_privkeys(self):
for i in range(len(self.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', rescan=True)
Expand Down
6 changes: 3 additions & 3 deletions test/functional/wallet_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ def restore_wallet_existent_name(self):
assert os.path.exists(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")
Expand Down
2 changes: 1 addition & 1 deletion test/functional/wallet_listdescriptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def skip_test_if_missing_module(self):
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):
Expand Down

0 comments on commit 66e77f7

Please sign in to comment.