Skip to content

Commit

Permalink
Merge bitcoin#23715: test: feature_rbf.py: check specified wallet typ…
Browse files Browse the repository at this point in the history
…e availability

84bc35d test: feature_rbf.py: check specified wallet type availability (Sebastian Falbesoner)

Pull request description:

  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, see e.g. bitcoin#23682 (comment)

  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.

  Should further pave the way for bitcoin#23682. On my local instance without BDB compiled, all targets in test_runner pass now.

ACKs for top commit:
  mzumsande:
    ACK 84bc35d, changes loook good for me and I confirmed that this fixes the error encountered on master when running the test `--without-bdb`.

Tree-SHA512: 1575c03c793c8e0ac195d0914eff75d02604301c8fb77d0fdb7c0b245561569c0c7db387ef4de499044b68ab6e14b4b78b955f6e74c84197bcaed95f439c9824
  • Loading branch information
MarcoFalke committed Dec 9, 2021
2 parents 68ca867 + 84bc35d commit 529ed33
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion test/functional/feature_rbf.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ def test_rpc(self):
assert_equal(json0["vin"][0]["sequence"], 4294967293)
assert_equal(json1["vin"][0]["sequence"], 4294967295)

if self.is_wallet_compiled():
if self.is_specified_wallet_compiled():
self.init_wallet(node=0)
rawtx2 = self.nodes[0].createrawtransaction([], outs)
frawtx2a = self.nodes[0].fundrawtransaction(rawtx2, {"replaceable": True})
Expand Down
6 changes: 0 additions & 6 deletions test/functional/interface_bitcoin_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ def cli_get_info_string_to_dict(cli_get_info_string):


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):
self.setup_clean_chain = True
self.num_nodes = 1
Expand Down
8 changes: 8 additions & 0 deletions test/functional/test_framework/test_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,14 @@ def is_wallet_compiled(self):
"""Checks whether the wallet module was compiled."""
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):
"""Checks whether bitcoin-wallet was compiled."""
return self.config["components"].getboolean("ENABLE_WALLET_TOOL")
Expand Down

0 comments on commit 529ed33

Please sign in to comment.