aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2017-08-15 11:33:39 -0400
committerJohn Newbery <john@johnnewbery.com>2017-11-10 16:07:37 -0500
commit5e0ba8f8cd55a5c2cea4e4e2343d7dcd52aa8fad (patch)
treeded7c100a7df6cd9d06479e52243e33f93191e2c /test
parentea0cd24f7d01f23fd5340c2afc644c760ff518a9 (diff)
[wallet] getreceivedbyaddress should return error if address is not mine
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/receivedby.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/functional/receivedby.py b/test/functional/receivedby.py
index c40572f577..97da19546f 100755
--- a/test/functional/receivedby.py
+++ b/test/functional/receivedby.py
@@ -6,7 +6,10 @@
from decimal import Decimal
from test_framework.test_framework import BitcoinTestFramework
-from test_framework.util import assert_array_result, assert_equal
+from test_framework.util import (assert_array_result,
+ assert_equal,
+ assert_raises_rpc_error,
+ )
class ReceivedByTest(BitcoinTestFramework):
def set_test_params(self):
@@ -68,6 +71,9 @@ class ReceivedByTest(BitcoinTestFramework):
balance = self.nodes[1].getreceivedbyaddress(addr)
assert_equal(balance, Decimal("0.1"))
+ # Trying to getreceivedby for an address the wallet doesn't own should return an error
+ assert_raises_rpc_error(-4, "Address not found in wallet", self.nodes[0].getreceivedbyaddress, addr)
+
self.log.info("listreceivedbyaccount + getreceivedbyaccount Test")
# set pre-state