Repository navigation
test: Get rid of default wallet hacks - #20034
Conversation
…ables No changes in behavior
- 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 bitcoin#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)
| # should not initialize if wallet path can't be created | ||
| exp_stderr = "boost::filesystem::create_directory:" | ||
| self.nodes[0].assert_start_raises_init_error(['-wallet=wallet.dat/bad'], exp_stderr, match=ErrorMatch.PARTIAL_REGEX) | ||
| self.nodes[0].assert_start_raises_init_error(['-wallet=w8/bad'], exp_stderr, match=ErrorMatch.PARTIAL_REGEX) |
There was a problem hiding this comment.
Note: This change isn't strictly necessary, but using w8 instead of wallet.dat here makes the test more robust so default_wallet_filename can be changed in the future. The top level wallet directory will always contain a w8 file, but may or may not contain a wallet.dat file, depending on the default_wallet_filename value.
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
Do all of the changes need to happen in one commit? Also, the build without wallet doesn't pass the tests |
|
Thanks, I'll check the no wallet build. I don't think this is PR hard to review. It was very difficult to write, because every one change I made broke other things and required more changes. But in the end, the main change was just dropping -wallet="" arguments and tweaking things to work around the dropped arguments. I would also expect if you're looking at one test and want to see how this PR affects the test, you'd rather look at one diff instead of multiple diffs. But I guess you have that option regardless by diffing across commits, so I'll see if there are sensible ways to have multiple commits. |
|
I don't really like removing the |
|
re: @achow101 #20034 (comment)
Thanks! Dropped commit be968c4 as I didn't realize it was separable. The change does seem like a win to me for simplicity and making things explicit, so maybe I will try to revive it in some form. But there's no reason to include it here. Updated c072c85 -> 5338dfa ( |
| self.assert_tool_output('', '-wallet=salvage', 'salvage') | ||
|
|
||
| def run_test(self): | ||
| self.wallet_path = os.path.join(self.nodes[0].datadir, self.chain, 'wallets', 'wallet.dat') |
There was a problem hiding this comment.
Should the -wallet=wallet.dat throughout this test use self.wallet_data_filename too then?
There was a problem hiding this comment.
re: #20034 (comment)
Should the
-wallet=wallet.datthroughout this test useself.wallet_data_filenametoo then?
It effectively is. I think you are maybe only looking at the first commit, not the overall diff? The wallet.dat references are removed in the second commit, since more robust way to refer to wallets is by directory name not data file name. (The data file name used inside wallets is an implementation detail and referring to it is only supported in limited cases for backwards compatibility. Dropping references to the data file name lets the test work with all default_wallet_name values.)
| wallet_names = ['w1', 'w2', 'w3', 'w', 'sub/w5', os.path.join(self.options.tmpdir, 'extern/w6'), 'w7_symlink', 'w8', ''] | ||
| extra_args = ['-wallet={}'.format(n) for n in wallet_names] | ||
| wallet_names = ['w1', 'w2', 'w3', 'w', 'sub/w5', os.path.join(self.options.tmpdir, 'extern/w6'), 'w7_symlink', 'w8', self.default_wallet_name] | ||
| extra_args = ['-nowallet'] + ['-wallet={}'.format(n) for n in wallet_names] |
There was a problem hiding this comment.
re: #20034 (comment)
Why?
Specifying -nowallet keeps test behavior unchanged now that the load on startup option is used. Probably if you were writing this test from scratch, you would drop -nowallet and instead change the checks below. But this is the most minimal update for the existing test, it is also nice because it keeps the test more narrow and robust to outside changes.
There was a problem hiding this comment.
in the first commit:
The test passes without this change, so I am still wondering why this is needed.
Also, the commit doesn't seem to be exhaustive. The wallet.dat/bad should be replaced as well. Also, the usages in tool_wallet.py. See the diff I used for testing:
diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp
index bd1d114730..89d7325e1c 100644
--- a/src/wallet/db.cpp
+++ b/src/wallet/db.cpp
@@ -20,6 +20,6 @@ void SplitWalletPath(const fs::path& wallet_path, fs::path& env_directory, std::
// Normal case: Interpret wallet path as a directory path containing
// data and log files.
env_directory = wallet_path;
- database_filename = "wallet.dat";
+ database_filename = "wallet_dat";
}
}
diff --git a/src/wallet/test/db_tests.cpp b/src/wallet/test/db_tests.cpp
index 8f0083cd2e..3489d48879 100644
--- a/src/wallet/test/db_tests.cpp
+++ b/src/wallet/test/db_tests.cpp
@@ -29,7 +29,7 @@ BOOST_AUTO_TEST_CASE(getwalletenv_file)
BOOST_AUTO_TEST_CASE(getwalletenv_directory)
{
- std::string expected_name = "wallet.dat";
+ std::string expected_name = "wallet_dat";
const fs::path datadir = GetDataDir();
std::string filename;
diff --git a/src/wallet/walletutil.cpp b/src/wallet/walletutil.cpp
index e4c72aed98..3a16cb3e75 100644
--- a/src/wallet/walletutil.cpp
+++ b/src/wallet/walletutil.cpp
@@ -71,11 +71,11 @@ std::vector<fs::path> ListWalletDir()
// This can be replaced by boost::filesystem::lexically_relative once boost is bumped to 1.60.
const fs::path path = it->path().string().substr(offset);
- if (it->status().type() == fs::directory_file && IsBerkeleyBtree(it->path() / "wallet.dat")) {
+ if (it->status().type() == fs::directory_file && IsBerkeleyBtree(it->path() / "wallet_dat")) {
// Found a directory which contains wallet.dat btree file, add it as a wallet.
paths.emplace_back(path);
} else if (it.level() == 0 && it->symlink_status().type() == fs::regular_file && IsBerkeleyBtree(it->path())) {
- if (it->path().filename() == "wallet.dat") {
+ if (it->path().filename() == "wallet_dat") {
// Found top-level wallet.dat btree file, add top level directory ""
// as a wallet.
paths.emplace_back();
diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py
index 100be26c59..fa72420178 100755
--- a/test/functional/test_framework/test_framework.py
+++ b/test/functional/test_framework/test_framework.py
@@ -103,7 +103,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
self.supports_cli = True
self.bind_to_localhost_only = True
self.default_wallet_name = ""
- self.wallet_data_filename = "wallet.dat"
+ self.wallet_data_filename = "wallet_dat"
self.set_test_params()
self.parse_args()
if self.options.timeout_factor == 0 :
diff --git a/test/functional/tool_wallet.py b/test/functional/tool_wallet.py
index ef68e224b6..8d3e7f8f62 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=wallet_dat',
'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=wallet_dat', '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=wallet_dat', 'info')
shasum_after = self.wallet_shasum()
timestamp_after = self.wallet_timestamp()
self.log.debug('Wallet file timestamp after calling info: {}'.format(timestamp_after))
diff --git a/test/functional/wallet_dump.py b/test/functional/wallet_dump.py
index 09581d864b..5fdabf89c8 100755
--- a/test/functional/wallet_dump.py
+++ b/test/functional/wallet_dump.py
@@ -203,7 +203,7 @@ class WalletDumpTest(BitcoinTestFramework):
assert result['ismine']
self.log.info('Check that wallet is flushed')
- with self.nodes[0].assert_debug_log(['Flushing wallet.dat'], timeout=20):
+ with self.nodes[0].assert_debug_log(['Flushing wallet_dat'], timeout=20):
self.nodes[0].getnewaddress()
diff --git a/test/functional/wallet_multiwallet.py b/test/functional/wallet_multiwallet.py
index 7b975af065..71aa86abdb 100755
--- a/test/functional/wallet_multiwallet.py
+++ b/test/functional/wallet_multiwallet.py
@@ -95,7 +95,7 @@ class MultiWalletTest(BitcoinTestFramework):
# w8 - to verify existing wallet file is loaded correctly
# '' - to verify default wallet file is created correctly
wallet_names = ['w1', 'w2', 'w3', 'w', 'sub/w5', os.path.join(self.options.tmpdir, 'extern/w6'), 'w7_symlink', 'w8', self.default_wallet_name]
- extra_args = ['-nowallet'] + ['-wallet={}'.format(n) for n in wallet_names]
+ extra_args = ['-wallet={}'.format(n) for n in wallet_names]
self.start_node(0, extra_args)
assert_equal(sorted(map(lambda w: w['name'], self.nodes[0].listwalletdir()['wallets'])), [self.default_wallet_name, os.path.join('sub', 'w5'), 'w', 'w1', 'w2', 'w3', 'w7', 'w7_symlink', 'w8'])
@@ -108,7 +108,7 @@ class MultiWalletTest(BitcoinTestFramework):
# should not initialize if wallet path can't be created
exp_stderr = "boost::filesystem::create_directory:"
- self.nodes[0].assert_start_raises_init_error(['-wallet=wallet.dat/bad'], exp_stderr, match=ErrorMatch.PARTIAL_REGEX)
+ self.nodes[0].assert_start_raises_init_error(['-wallet={}/bad'.format(self.wallet_data_filename)], exp_stderr, match=ErrorMatch.PARTIAL_REGEX)
self.nodes[0].assert_start_raises_init_error(['-walletdir=wallets'], 'Error: Specified -walletdir "wallets" does not exist')
self.nodes[0].assert_start_raises_init_error(['-walletdir=wallets'], 'Error: Specified -walletdir "wallets" is a relative path', cwd=data_dir())There was a problem hiding this comment.
re: #20034 (comment)
in the first commit:
The test passes without this change, so I am still wondering why this is needed.
Oh, good catch. That was supposed to be in the second commit not the first. -nowallet makes the list of wallets which are loaded explicit, and the tradeoffs around using it here are described in #20034 (comment). The change is necessary to be able to make default_wallet_name nonempty as described in PR description (to add multiwallet test coverage for #19077, to fix accidental wallet creation problems in #15454).
Also, the commit doesn't seem to be exhaustive. The
wallet.dat/badshould be replaced as well. Also, the usages intool_wallet.py. See the diff I used for testing:
That's a useful test, but I think it makes more sense to apply to the overall PR, not the first commit. Applying it to the first commit and making the first commit exhaustive with temporary changes that are subsequently replaced seems like it just adds more code to review and more opportunities to make mistakes in the PR. I would prefer not to make extra changes in the first commit if we can both agree it does not affect the final outcome.
|
ACK 5338dfa |
| wallet_names = ['w1', 'w2', 'w3', 'w', 'sub/w5', os.path.join(self.options.tmpdir, 'extern/w6'), 'w7_symlink', 'w8', ''] | ||
| extra_args = ['-wallet={}'.format(n) for n in wallet_names] | ||
| wallet_names = ['w1', 'w2', 'w3', 'w', 'sub/w5', os.path.join(self.options.tmpdir, 'extern/w6'), 'w7_symlink', 'w8', self.default_wallet_name] | ||
| extra_args = ['-nowallet'] + ['-wallet={}'.format(n) for n in wallet_names] |
There was a problem hiding this comment.
in the first commit:
The test passes without this change, so I am still wondering why this is needed.
Also, the commit doesn't seem to be exhaustive. The wallet.dat/bad should be replaced as well. Also, the usages in tool_wallet.py. See the diff I used for testing:
diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp
index bd1d114730..89d7325e1c 100644
--- a/src/wallet/db.cpp
+++ b/src/wallet/db.cpp
@@ -20,6 +20,6 @@ void SplitWalletPath(const fs::path& wallet_path, fs::path& env_directory, std::
// Normal case: Interpret wallet path as a directory path containing
// data and log files.
env_directory = wallet_path;
- database_filename = "wallet.dat";
+ database_filename = "wallet_dat";
}
}
diff --git a/src/wallet/test/db_tests.cpp b/src/wallet/test/db_tests.cpp
index 8f0083cd2e..3489d48879 100644
--- a/src/wallet/test/db_tests.cpp
+++ b/src/wallet/test/db_tests.cpp
@@ -29,7 +29,7 @@ BOOST_AUTO_TEST_CASE(getwalletenv_file)
BOOST_AUTO_TEST_CASE(getwalletenv_directory)
{
- std::string expected_name = "wallet.dat";
+ std::string expected_name = "wallet_dat";
const fs::path datadir = GetDataDir();
std::string filename;
diff --git a/src/wallet/walletutil.cpp b/src/wallet/walletutil.cpp
index e4c72aed98..3a16cb3e75 100644
--- a/src/wallet/walletutil.cpp
+++ b/src/wallet/walletutil.cpp
@@ -71,11 +71,11 @@ std::vector<fs::path> ListWalletDir()
// This can be replaced by boost::filesystem::lexically_relative once boost is bumped to 1.60.
const fs::path path = it->path().string().substr(offset);
- if (it->status().type() == fs::directory_file && IsBerkeleyBtree(it->path() / "wallet.dat")) {
+ if (it->status().type() == fs::directory_file && IsBerkeleyBtree(it->path() / "wallet_dat")) {
// Found a directory which contains wallet.dat btree file, add it as a wallet.
paths.emplace_back(path);
} else if (it.level() == 0 && it->symlink_status().type() == fs::regular_file && IsBerkeleyBtree(it->path())) {
- if (it->path().filename() == "wallet.dat") {
+ if (it->path().filename() == "wallet_dat") {
// Found top-level wallet.dat btree file, add top level directory ""
// as a wallet.
paths.emplace_back();
diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py
index 100be26c59..fa72420178 100755
--- a/test/functional/test_framework/test_framework.py
+++ b/test/functional/test_framework/test_framework.py
@@ -103,7 +103,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
self.supports_cli = True
self.bind_to_localhost_only = True
self.default_wallet_name = ""
- self.wallet_data_filename = "wallet.dat"
+ self.wallet_data_filename = "wallet_dat"
self.set_test_params()
self.parse_args()
if self.options.timeout_factor == 0 :
diff --git a/test/functional/tool_wallet.py b/test/functional/tool_wallet.py
index ef68e224b6..8d3e7f8f62 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=wallet_dat',
'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=wallet_dat', '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=wallet_dat', 'info')
shasum_after = self.wallet_shasum()
timestamp_after = self.wallet_timestamp()
self.log.debug('Wallet file timestamp after calling info: {}'.format(timestamp_after))
diff --git a/test/functional/wallet_dump.py b/test/functional/wallet_dump.py
index 09581d864b..5fdabf89c8 100755
--- a/test/functional/wallet_dump.py
+++ b/test/functional/wallet_dump.py
@@ -203,7 +203,7 @@ class WalletDumpTest(BitcoinTestFramework):
assert result['ismine']
self.log.info('Check that wallet is flushed')
- with self.nodes[0].assert_debug_log(['Flushing wallet.dat'], timeout=20):
+ with self.nodes[0].assert_debug_log(['Flushing wallet_dat'], timeout=20):
self.nodes[0].getnewaddress()
diff --git a/test/functional/wallet_multiwallet.py b/test/functional/wallet_multiwallet.py
index 7b975af065..71aa86abdb 100755
--- a/test/functional/wallet_multiwallet.py
+++ b/test/functional/wallet_multiwallet.py
@@ -95,7 +95,7 @@ class MultiWalletTest(BitcoinTestFramework):
# w8 - to verify existing wallet file is loaded correctly
# '' - to verify default wallet file is created correctly
wallet_names = ['w1', 'w2', 'w3', 'w', 'sub/w5', os.path.join(self.options.tmpdir, 'extern/w6'), 'w7_symlink', 'w8', self.default_wallet_name]
- extra_args = ['-nowallet'] + ['-wallet={}'.format(n) for n in wallet_names]
+ extra_args = ['-wallet={}'.format(n) for n in wallet_names]
self.start_node(0, extra_args)
assert_equal(sorted(map(lambda w: w['name'], self.nodes[0].listwalletdir()['wallets'])), [self.default_wallet_name, os.path.join('sub', 'w5'), 'w', 'w1', 'w2', 'w3', 'w7', 'w7_symlink', 'w8'])
@@ -108,7 +108,7 @@ class MultiWalletTest(BitcoinTestFramework):
# should not initialize if wallet path can't be created
exp_stderr = "boost::filesystem::create_directory:"
- self.nodes[0].assert_start_raises_init_error(['-wallet=wallet.dat/bad'], exp_stderr, match=ErrorMatch.PARTIAL_REGEX)
+ self.nodes[0].assert_start_raises_init_error(['-wallet={}/bad'.format(self.wallet_data_filename)], exp_stderr, match=ErrorMatch.PARTIAL_REGEX)
self.nodes[0].assert_start_raises_init_error(['-walletdir=wallets'], 'Error: Specified -walletdir "wallets" does not exist')
self.nodes[0].assert_start_raises_init_error(['-walletdir=wallets'], 'Error: Specified -walletdir "wallets" is a relative path', cwd=data_dir())| wallet_names = ['w1', 'w2', 'w3', 'w', 'sub/w5', os.path.join(self.options.tmpdir, 'extern/w6'), 'w7_symlink', 'w8', ''] | ||
| extra_args = ['-wallet={}'.format(n) for n in wallet_names] | ||
| wallet_names = ['w1', 'w2', 'w3', 'w', 'sub/w5', os.path.join(self.options.tmpdir, 'extern/w6'), 'w7_symlink', 'w8', self.default_wallet_name] | ||
| extra_args = ['-nowallet'] + ['-wallet={}'.format(n) for n in wallet_names] |
There was a problem hiding this comment.
re: #20034 (comment)
in the first commit:
The test passes without this change, so I am still wondering why this is needed.
Oh, good catch. That was supposed to be in the second commit not the first. -nowallet makes the list of wallets which are loaded explicit, and the tradeoffs around using it here are described in #20034 (comment). The change is necessary to be able to make default_wallet_name nonempty as described in PR description (to add multiwallet test coverage for #19077, to fix accidental wallet creation problems in #15454).
Also, the commit doesn't seem to be exhaustive. The
wallet.dat/badshould be replaced as well. Also, the usages intool_wallet.py. See the diff I used for testing:
That's a useful test, but I think it makes more sense to apply to the overall PR, not the first commit. Applying it to the first commit and making the first commit exhaustive with temporary changes that are subsequently replaced seems like it just adds more code to review and more opportunities to make mistakes in the PR. I would prefer not to make extra changes in the first commit if we can both agree it does not affect the final outcome.
|
ACK c1585bc, only effective change is adding documentation 🎵 Show signature and timestampSignature: Timestamp of file with hash |
|
Tested with diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp
index bd1d114730..89d7325e1c 100644
--- a/src/wallet/db.cpp
+++ b/src/wallet/db.cpp
@@ -20,6 +20,6 @@ void SplitWalletPath(const fs::path& wallet_path, fs::path& env_directory, std::
// Normal case: Interpret wallet path as a directory path containing
// data and log files.
env_directory = wallet_path;
- database_filename = "wallet.dat";
+ database_filename = "wallet_dat";
}
}
diff --git a/src/wallet/test/db_tests.cpp b/src/wallet/test/db_tests.cpp
index 8f0083cd2e..3489d48879 100644
--- a/src/wallet/test/db_tests.cpp
+++ b/src/wallet/test/db_tests.cpp
@@ -29,7 +29,7 @@ BOOST_AUTO_TEST_CASE(getwalletenv_file)
BOOST_AUTO_TEST_CASE(getwalletenv_directory)
{
- std::string expected_name = "wallet.dat";
+ std::string expected_name = "wallet_dat";
const fs::path datadir = GetDataDir();
std::string filename;
diff --git a/src/wallet/walletutil.cpp b/src/wallet/walletutil.cpp
index e4c72aed98..3a16cb3e75 100644
--- a/src/wallet/walletutil.cpp
+++ b/src/wallet/walletutil.cpp
@@ -71,11 +71,11 @@ std::vector<fs::path> ListWalletDir()
// This can be replaced by boost::filesystem::lexically_relative once boost is bumped to 1.60.
const fs::path path = it->path().string().substr(offset);
- if (it->status().type() == fs::directory_file && IsBerkeleyBtree(it->path() / "wallet.dat")) {
+ if (it->status().type() == fs::directory_file && IsBerkeleyBtree(it->path() / "wallet_dat")) {
// Found a directory which contains wallet.dat btree file, add it as a wallet.
paths.emplace_back(path);
} else if (it.level() == 0 && it->symlink_status().type() == fs::regular_file && IsBerkeleyBtree(it->path())) {
- if (it->path().filename() == "wallet.dat") {
+ if (it->path().filename() == "wallet_dat") {
// Found top-level wallet.dat btree file, add top level directory ""
// as a wallet.
paths.emplace_back();
diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py
index 2824d80434..6ab813ff1c 100755
--- a/test/functional/test_framework/test_framework.py
+++ b/test/functional/test_framework/test_framework.py
@@ -104,7 +104,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
self.bind_to_localhost_only = True
self.parse_args()
self.default_wallet_name = ""
- self.wallet_data_filename = "wallet.dat"
+ self.wallet_data_filename = "wallet_dat"
# Optional list of wallet names that can be set in set_test_params to
# create and import keys to. If unset, default is len(nodes) *
# [default_wallet_name]. If wallet names are None, wallet creation is
diff --git a/test/functional/wallet_dump.py b/test/functional/wallet_dump.py
index 09581d864b..5fdabf89c8 100755
--- a/test/functional/wallet_dump.py
+++ b/test/functional/wallet_dump.py
@@ -203,7 +203,7 @@ class WalletDumpTest(BitcoinTestFramework):
assert result['ismine']
self.log.info('Check that wallet is flushed')
- with self.nodes[0].assert_debug_log(['Flushing wallet.dat'], timeout=20):
+ with self.nodes[0].assert_debug_log(['Flushing wallet_dat'], timeout=20):
self.nodes[0].getnewaddress()
|
…ables Summary: No changes in behavior This is a backport of [[bitcoin/bitcoin#20034 | core#20034]] [1/2] bitcoin/bitcoin@ed3acda Test Plan: `ninja check-functional` Reviewers: #bitcoin_abc, majcosta Reviewed By: #bitcoin_abc, majcosta Differential Revision: https://reviews.bitcoinabc.org/D10421
Summary: - 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) This is a backport of [[bitcoin/bitcoin#20034 | core#20034]] [2/2] bitcoin/bitcoin@c1585bc Depends on D10421 Test Plan: `ninja check-functional-extended` Reviewers: #bitcoin_abc, majcosta Reviewed By: #bitcoin_abc, majcosta Subscribers: majcosta Differential Revision: https://reviews.bitcoinabc.org/D10422
Changes:
-wallet,-nowallet,-disablewallet) argument rewriting""names and-wallet=""argsMotivation:
""string literals withdefault_wallet_namereferences-walletarguments to create wallets, so it is easy to change-walletoption 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)