aboutsummaryrefslogtreecommitdiff
path: root/test/functional/tool_wallet.py
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2020-09-28 20:24:06 -0400
committerRussell Yanofsky <russ@yanofsky.org>2020-09-29 04:35:01 -0400
commitc1585bca8dae01dee6a1dd8eadae2f8b100503df (patch)
treed361e4c330412af6f2a6356787da4030c5553e51 /test/functional/tool_wallet.py
parented3acda33b75d1b546ee696a63def239bcdd62de (diff)
downloadbitcoin-c1585bca8dae01dee6a1dd8eadae2f8b100503df.tar.xz
test: Get rid of default wallet hacks
- Get rid of hardcoded wallet "" names and -wallet="" args - Get rid of setup_nodes (-wallet, -nowallet, -disablewallet) argument rewriting Motivation: - Simplify test framework behavior so it's easier to write new tests without having arguments mangled by the framework - Make tests more readable, replacing unexplained "" string literals with default_wallet_name references - Make it trivial to update default wallet name and wallet data filename for sqlite #19077 testing - Stop relying on -wallet arguments to create wallets, so it is easy to change -wallet option in the future to only load existing wallets not create new ones (to avoid accidental wallet creation, and encourage use of wallet encryption and descriptor features)
Diffstat (limited to 'test/functional/tool_wallet.py')
-rwxr-xr-xtest/functional/tool_wallet.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/functional/tool_wallet.py b/test/functional/tool_wallet.py
index ef68e224b6..3f25c58851 100755
--- a/test/functional/tool_wallet.py
+++ b/test/functional/tool_wallet.py
@@ -73,7 +73,7 @@ class ToolWalletTest(BitcoinTestFramework):
locked_dir = os.path.join(self.options.tmpdir, "node0", "regtest", "wallets")
self.assert_raises_tool_error(
'Error initializing wallet database environment "{}"!'.format(locked_dir),
- '-wallet=wallet.dat',
+ '-wallet=' + self.default_wallet_name,
'info',
)
path = os.path.join(self.options.tmpdir, "node0", "regtest", "wallets", "nonexistent.dat")
@@ -104,7 +104,7 @@ class ToolWalletTest(BitcoinTestFramework):
Transactions: 0
Address Book: 3
''')
- self.assert_tool_output(out, '-wallet=wallet.dat', 'info')
+ self.assert_tool_output(out, '-wallet=' + self.default_wallet_name, 'info')
timestamp_after = self.wallet_timestamp()
self.log.debug('Wallet file timestamp after calling info: {}'.format(timestamp_after))
self.log_wallet_timestamp_comparison(timestamp_before, timestamp_after)
@@ -143,7 +143,7 @@ class ToolWalletTest(BitcoinTestFramework):
Transactions: 1
Address Book: 3
''')
- self.assert_tool_output(out, '-wallet=wallet.dat', 'info')
+ self.assert_tool_output(out, '-wallet=' + self.default_wallet_name, 'info')
shasum_after = self.wallet_shasum()
timestamp_after = self.wallet_timestamp()
self.log.debug('Wallet file timestamp after calling info: {}'.format(timestamp_after))
@@ -181,7 +181,7 @@ class ToolWalletTest(BitcoinTestFramework):
def test_getwalletinfo_on_different_wallet(self):
self.log.info('Starting node with arg -wallet=foo')
- self.start_node(0, ['-wallet=foo'])
+ self.start_node(0, ['-nowallet', '-wallet=foo'])
self.log.info('Calling getwalletinfo on a different wallet ("foo"), testing output')
shasum_before = self.wallet_shasum()