aboutsummaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorRussell Yanofsky <[email protected]>2017-02-13 17:54:51 -0500
committerRussell Yanofsky <[email protected]>2017-02-13 17:54:51 -0500
commit9acf25cc013c013ee5b07dba7b1319b7c5a7b6a4 (patch)
tree4565391074de7304a344e97c1418ada6ff11fc38 /qa
parentMerge #9736: Pre-0.14.0 hardcoded seeds update (diff)
downloaddiscoin-9acf25cc013c013ee5b07dba7b1319b7c5a7b6a4.tar.xz
discoin-9acf25cc013c013ee5b07dba7b1319b7c5a7b6a4.zip
Return error when importmulti called with invalid address.
Lack of error checking noticed by Alex Morcos <[email protected]>
Diffstat (limited to 'qa')
-rwxr-xr-xqa/rpc-tests/importmulti.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/qa/rpc-tests/importmulti.py b/qa/rpc-tests/importmulti.py
index e100a3af9..43964610e 100755
--- a/qa/rpc-tests/importmulti.py
+++ b/qa/rpc-tests/importmulti.py
@@ -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")