aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-10-11 11:27:34 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-10-11 11:27:37 +0200
commit1790a8ddacae0d52135f5020894ef1ceef625cf9 (patch)
tree3b9cc5761a051218dad3edaef99174c6fc39292c
parent5b7210c8745d9572fe94620f848d4ee1304c91a7 (diff)
parentc2fbdca54915e85ffafe1a88858d3c70c2b1afe8 (diff)
downloadbitcoin-1790a8ddacae0d52135f5020894ef1ceef625cf9.tar.xz
Merge bitcoin/bitcoin#22794: test: Verify if wallet is compiled in rpc_invalid_address_message.py test
c2fbdca54915e85ffafe1a88858d3c70c2b1afe8 Add BECH32_INVALID_VERSION test (lsilva01) b142f79ddb91a44f29fcb2afb7f2edf3ca17e168 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
-rwxr-xr-xtest/functional/rpc_invalid_address_message.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/functional/rpc_invalid_address_message.py b/test/functional/rpc_invalid_address_message.py
index e362642f0f..7ab5a5e90d 100755
--- a/test/functional/rpc_invalid_address_message.py
+++ b/test/functional/rpc_invalid_address_message.py
@@ -29,9 +29,6 @@ class InvalidAddressErrorMessageTest(BitcoinTestFramework):
self.setup_clean_chain = True
self.num_nodes = 1
- def skip_test_if_missing_module(self):
- self.skip_if_no_wallet()
-
def test_validateaddress(self):
node = self.nodes[0]
@@ -60,6 +57,10 @@ class InvalidAddressErrorMessageTest(BitcoinTestFramework):
assert info['isvalid']
assert 'error' not in info
+ info = node.validateaddress(BECH32_INVALID_VERSION)
+ assert not info['isvalid']
+ assert_equal(info['error'], 'Invalid Bech32 address witness version')
+
# Base58
info = node.validateaddress(BASE58_INVALID_PREFIX)
assert not info['isvalid']
@@ -87,7 +88,10 @@ class InvalidAddressErrorMessageTest(BitcoinTestFramework):
def run_test(self):
self.test_validateaddress()
- self.test_getaddressinfo()
+
+ if self.is_wallet_compiled():
+ self.init_wallet(0)
+ self.test_getaddressinfo()
if __name__ == '__main__':