mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-12 11:19:08 -05:00
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.
This commit is contained in:
parent
f727d814bd
commit
84bc35d7a5
3 changed files with 9 additions and 7 deletions
|
@ -538,7 +538,7 @@ class ReplaceByFeeTest(BitcoinTestFramework):
|
||||||
assert_equal(json0["vin"][0]["sequence"], 4294967293)
|
assert_equal(json0["vin"][0]["sequence"], 4294967293)
|
||||||
assert_equal(json1["vin"][0]["sequence"], 4294967295)
|
assert_equal(json1["vin"][0]["sequence"], 4294967295)
|
||||||
|
|
||||||
if self.is_wallet_compiled():
|
if self.is_specified_wallet_compiled():
|
||||||
self.init_wallet(node=0)
|
self.init_wallet(node=0)
|
||||||
rawtx2 = self.nodes[0].createrawtransaction([], outs)
|
rawtx2 = self.nodes[0].createrawtransaction([], outs)
|
||||||
frawtx2a = self.nodes[0].fundrawtransaction(rawtx2, {"replaceable": True})
|
frawtx2a = self.nodes[0].fundrawtransaction(rawtx2, {"replaceable": True})
|
||||||
|
|
|
@ -66,12 +66,6 @@ def cli_get_info_string_to_dict(cli_get_info_string):
|
||||||
|
|
||||||
|
|
||||||
class TestBitcoinCli(BitcoinTestFramework):
|
class TestBitcoinCli(BitcoinTestFramework):
|
||||||
def is_specified_wallet_compiled(self):
|
|
||||||
if self.options.descriptors:
|
|
||||||
return self.is_sqlite_compiled()
|
|
||||||
else:
|
|
||||||
return self.is_bdb_compiled()
|
|
||||||
|
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
|
|
|
@ -886,6 +886,14 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
||||||
"""Checks whether the wallet module was compiled."""
|
"""Checks whether the wallet module was compiled."""
|
||||||
return self.config["components"].getboolean("ENABLE_WALLET")
|
return self.config["components"].getboolean("ENABLE_WALLET")
|
||||||
|
|
||||||
|
def is_specified_wallet_compiled(self):
|
||||||
|
"""Checks whether wallet support for the specified type
|
||||||
|
(legacy or descriptor wallet) was compiled."""
|
||||||
|
if self.options.descriptors:
|
||||||
|
return self.is_sqlite_compiled()
|
||||||
|
else:
|
||||||
|
return self.is_bdb_compiled()
|
||||||
|
|
||||||
def is_wallet_tool_compiled(self):
|
def is_wallet_tool_compiled(self):
|
||||||
"""Checks whether bitcoin-wallet was compiled."""
|
"""Checks whether bitcoin-wallet was compiled."""
|
||||||
return self.config["components"].getboolean("ENABLE_WALLET_TOOL")
|
return self.config["components"].getboolean("ENABLE_WALLET_TOOL")
|
||||||
|
|
Loading…
Add table
Reference in a new issue