test, refactor: Add TestNode.binaries to hold binary paths

Add new TestNode.binaries object to manage paths to bitcoin binaries.

Having this object makes it possible for the test framework to exercise the
bitcoin wrapper executable introduced in
https://github.com/bitcoin/bitcoin/pull/31375 and also makes it easier to add
new binaries and options and environment variables controlling how they are
invoked, because logic for invoking them that was previously spread out is now
consolidated in one place.

Co-authored-by: Sjors Provoost <sjors@sprovoost.nl>
This commit is contained in:
Ryan Ofsky
2024-11-26 11:51:41 -05:00
parent 223fc24c4e
commit 0d2eefca8b
5 changed files with 77 additions and 34 deletions

View File

@@ -112,7 +112,7 @@ class WalletEncryptionTest(BitcoinTestFramework):
def do_wallet_tool(*args):
proc = subprocess.Popen(
[self.options.bitcoinwallet, f"-datadir={self.nodes[0].datadir_path}", f"-chain={self.chain}"] + list(args),
self.get_binaries().wallet_argv() + [f"-datadir={self.nodes[0].datadir_path}", f"-chain={self.chain}"] + list(args),
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,