|
|
|
@ -63,12 +63,12 @@ class InvalidAddressErrorMessageTest(BitcoinTestFramework):
|
|
|
|
|
|
|
|
|
|
def test_validateaddress(self):
|
|
|
|
|
# Invalid Bech32
|
|
|
|
|
self.check_invalid(BECH32_INVALID_SIZE, "Invalid Bech32 address program size (41 byte)")
|
|
|
|
|
self.check_invalid(BECH32_INVALID_SIZE, "Invalid Bech32 address program size (41 bytes)")
|
|
|
|
|
self.check_invalid(BECH32_INVALID_PREFIX, 'Invalid or unsupported Segwit (Bech32) or Base58 encoding.')
|
|
|
|
|
self.check_invalid(BECH32_INVALID_BECH32, 'Version 1+ witness address must use Bech32m checksum')
|
|
|
|
|
self.check_invalid(BECH32_INVALID_BECH32M, 'Version 0 witness address must use Bech32 checksum')
|
|
|
|
|
self.check_invalid(BECH32_INVALID_VERSION, 'Invalid Bech32 address witness version')
|
|
|
|
|
self.check_invalid(BECH32_INVALID_V0_SIZE, "Invalid Bech32 v0 address program size (21 byte), per BIP141")
|
|
|
|
|
self.check_invalid(BECH32_INVALID_V0_SIZE, "Invalid Bech32 v0 address program size (21 bytes), per BIP141")
|
|
|
|
|
self.check_invalid(BECH32_TOO_LONG, 'Bech32 string too long', list(range(90, 108)))
|
|
|
|
|
self.check_invalid(BECH32_ONE_ERROR, 'Invalid Bech32 checksum', [9])
|
|
|
|
|
self.check_invalid(BECH32_TWO_ERRORS, 'Invalid Bech32 checksum', [22, 43])
|
|
|
|
@ -105,7 +105,7 @@ class InvalidAddressErrorMessageTest(BitcoinTestFramework):
|
|
|
|
|
def test_getaddressinfo(self):
|
|
|
|
|
node = self.nodes[0]
|
|
|
|
|
|
|
|
|
|
assert_raises_rpc_error(-5, "Invalid Bech32 address program size (41 byte)", node.getaddressinfo, BECH32_INVALID_SIZE)
|
|
|
|
|
assert_raises_rpc_error(-5, "Invalid Bech32 address program size (41 bytes)", node.getaddressinfo, BECH32_INVALID_SIZE)
|
|
|
|
|
assert_raises_rpc_error(-5, "Invalid or unsupported Segwit (Bech32) or Base58 encoding.", node.getaddressinfo, BECH32_INVALID_PREFIX)
|
|
|
|
|
assert_raises_rpc_error(-5, "Invalid or unsupported Base58-encoded address.", node.getaddressinfo, BASE58_INVALID_PREFIX)
|
|
|
|
|
assert_raises_rpc_error(-5, "Invalid or unsupported Segwit (Bech32) or Base58 encoding.", node.getaddressinfo, INVALID_ADDRESS)
|
|
|
|
|