Skip to content

Commit f727d81

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#23712: test: interface_bitcoin_cli.py: check specified wallet type availability
b57bf25 test: interface_bitcoin_cli.py: check specified wallet type availability (Sebastian Falbesoner) Pull request description: Currently the test `interface_bitcoin_cli.py` performs the wallet-relevant parts if _any_ wallet type support is compiled in, independently of whether the test is run with legacy or descriptor wallet specified. This leads to a failure if the test is started with the `--legacy-wallet` parameter, but bitcoind is compiled without BDB support, see e.g bitcoin/bitcoin#23686 (comment) Fix this by checking if the specified wallet type (BDB for legacy wallet, SQLite for descriptor wallet) is available. Should further pave the way for #23682. ACKs for top commit: achow101: ACK b57bf25 Tree-SHA512: ddb5a94ba61133eff8de79d4946b3b9d476232b26e83bf768894cac4691e72602f88b6c02c72b992e12c2feb9bff1f0a2e0a265948a00954311104add1347184
2 parents 926fc2a + b57bf25 commit f727d81

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

test/functional/interface_bitcoin_cli.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,16 @@ 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+
6975
def set_test_params(self):
7076
self.setup_clean_chain = True
7177
self.num_nodes = 1
72-
if self.is_wallet_compiled():
78+
if self.is_specified_wallet_compiled():
7379
self.requires_wallet = True
7480

7581
def skip_test_if_missing_module(self):
@@ -113,7 +119,7 @@ def run_test(self):
113119
assert_raises_process_error(1, "Invalid value for -color option. Valid values: always, auto, never.", self.nodes[0].cli('-getinfo', '-color=foo').send_cli)
114120

115121
self.log.info("Test -getinfo returns expected network and blockchain info")
116-
if self.is_wallet_compiled():
122+
if self.is_specified_wallet_compiled():
117123
self.nodes[0].encryptwallet(password)
118124
cli_get_info_string = self.nodes[0].cli('-getinfo').send_cli()
119125
cli_get_info = cli_get_info_string_to_dict(cli_get_info_string)
@@ -138,7 +144,7 @@ def run_test(self):
138144
cli_get_info = cli_get_info_string_to_dict(cli_get_info_string)
139145
assert_equal(cli_get_info["Proxies"], "127.0.0.1:9050 (ipv4, ipv6, onion, cjdns), 127.0.0.1:7656 (i2p)")
140146

141-
if self.is_wallet_compiled():
147+
if self.is_specified_wallet_compiled():
142148
self.log.info("Test -getinfo and bitcoin-cli getwalletinfo return expected wallet info")
143149
# Explicitely set the output type in order to have constintent tx vsize / fees
144150
# for both legacy and descriptor wallets (disables the change address type detection algorithm)

0 commit comments

Comments
 (0)