mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Return error when importmulti called with invalid address.
Lack of error checking noticed by Alex Morcos <morcos@chaincode.com>
This commit is contained in:
@@ -59,6 +59,16 @@ class ImportMultiTest (BitcoinTestFramework):
|
||||
assert_equal(address_assert['iswatchonly'], True)
|
||||
assert_equal(address_assert['ismine'], False)
|
||||
|
||||
print("Should not import an invalid address")
|
||||
result = self.nodes[1].importmulti([{
|
||||
"scriptPubKey": {
|
||||
"address": "not valid address",
|
||||
},
|
||||
"timestamp": "now",
|
||||
}])
|
||||
assert_equal(result[0]['success'], False)
|
||||
assert_equal(result[0]['error']['code'], -5)
|
||||
assert_equal(result[0]['error']['message'], 'Invalid address')
|
||||
|
||||
# ScriptPubKey + internal
|
||||
print("Should import a scriptPubKey with internal flag")
|
||||
|
||||
Reference in New Issue
Block a user