Skip to content

Commit 84bc35d

Browse files
committed
test: feature_rbf.py: check specified wallet type availability
The test currently leads to a failure if in general wallet support is compiled, but the library for the specified type (BDB/SQLite) is not, i.e. if started with the `--legacy-wallet` parameter, but bitcoind is compiled without BDB support. Fix this by checking if the specified wallet type (BDB for legacy wallet, SQLite for descriptor wallet) is available. Also move the helper `is_specified_wallet_compiled()` to the test framework's class BitcoinTestFramework first, so it can be reused.
1 parent f727d81 commit 84bc35d

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

test/functional/feature_rbf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ def test_rpc(self):
538538
assert_equal(json0["vin"][0]["sequence"], 4294967293)
539539
assert_equal(json1["vin"][0]["sequence"], 4294967295)
540540

541-
if self.is_wallet_compiled():
541+
if self.is_specified_wallet_compiled():
542542
self.init_wallet(node=0)
543543
rawtx2 = self.nodes[0].createrawtransaction([], outs)
544544
frawtx2a = self.nodes[0].fundrawtransaction(rawtx2, {"replaceable": True})

test/functional/interface_bitcoin_cli.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@ def cli_get_info_string_to_dict(cli_get_info_string):
6666

6767

6868
class TestBitcoinCli(BitcoinTestFramework):
69-
def is_specified_wallet_compiled(self):
70-
if self.options.descriptors:
71-
return self.is_sqlite_compiled()
72-
else:
73-
return self.is_bdb_compiled()
74-
7569
def set_test_params(self):
7670
self.setup_clean_chain = True
7771
self.num_nodes = 1

test/functional/test_framework/test_framework.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,14 @@ def is_wallet_compiled(self):
886886
"""Checks whether the wallet module was compiled."""
887887
return self.config["components"].getboolean("ENABLE_WALLET")
888888

889+
def is_specified_wallet_compiled(self):
890+
"""Checks whether wallet support for the specified type
891+
(legacy or descriptor wallet) was compiled."""
892+
if self.options.descriptors:
893+
return self.is_sqlite_compiled()
894+
else:
895+
return self.is_bdb_compiled()
896+
889897
def is_wallet_tool_compiled(self):
890898
"""Checks whether bitcoin-wallet was compiled."""
891899
return self.config["components"].getboolean("ENABLE_WALLET_TOOL")

0 commit comments

Comments
 (0)