Skip to content

Commit 1790a8d

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#22794: test: Verify if wallet is compiled in rpc_invalid_address_message.py test
c2fbdca Add BECH32_INVALID_VERSION test (lsilva01) b142f79 skip test_getaddressinfo() if wallet is disabled (lsilva01) Pull request description: Most of `test/functional/rpc_invalid_address_message.py` does not requires wallet. But if the project is compiled in disable-wallet mode, the entire test will be skipped. This PR changes the test to run the RPC tests first and then checks if the wallet is compiled. ACKs for top commit: stratospher: tested ACK c2fbdca Tree-SHA512: 11fa2fedf4a15aa45e3f12490df8e22290a867d5de594247211499533c32289c68c0b60bd42dbf8305e43dbcc042789e7139317ef5c9f8cf386f2d84c91b9ac2
2 parents 5b7210c + c2fbdca commit 1790a8d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/functional/rpc_invalid_address_message.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ def set_test_params(self):
2929
self.setup_clean_chain = True
3030
self.num_nodes = 1
3131

32-
def skip_test_if_missing_module(self):
33-
self.skip_if_no_wallet()
34-
3532
def test_validateaddress(self):
3633
node = self.nodes[0]
3734

@@ -60,6 +57,10 @@ def test_validateaddress(self):
6057
assert info['isvalid']
6158
assert 'error' not in info
6259

60+
info = node.validateaddress(BECH32_INVALID_VERSION)
61+
assert not info['isvalid']
62+
assert_equal(info['error'], 'Invalid Bech32 address witness version')
63+
6364
# Base58
6465
info = node.validateaddress(BASE58_INVALID_PREFIX)
6566
assert not info['isvalid']
@@ -87,7 +88,10 @@ def test_getaddressinfo(self):
8788

8889
def run_test(self):
8990
self.test_validateaddress()
90-
self.test_getaddressinfo()
91+
92+
if self.is_wallet_compiled():
93+
self.init_wallet(0)
94+
self.test_getaddressinfo()
9195

9296

9397
if __name__ == '__main__':

0 commit comments

Comments
 (0)