Merge #14417: Fix listreceivedbyaddress not taking address as a string

d4d70eda33 Fix listreceivedbyaddress not taking address as a string (Eric Scrivner)

Pull request description:

  Fixes #14173. Add the patch in #14173 and include a regression test.

Tree-SHA512: 5a9794e0c43e90d18c899841afbaf15eb9129d7d2f6570fccf0a1793697fe170d224c3c3995b1a35c536fac19819042823d9e3bd23b019d0f03434499243d2f5
This commit is contained in:
MarcoFalke 2018-10-23 19:03:45 -04:00
commit 94cf1ec948
No known key found for this signature in database
GPG key ID: D2EA4850E7528B25
2 changed files with 4 additions and 1 deletions

View file

@ -45,7 +45,6 @@ static const CRPCConvertParam vRPCConvertParams[] =
{ "listreceivedbyaddress", 0, "minconf" }, { "listreceivedbyaddress", 0, "minconf" },
{ "listreceivedbyaddress", 1, "include_empty" }, { "listreceivedbyaddress", 1, "include_empty" },
{ "listreceivedbyaddress", 2, "include_watchonly" }, { "listreceivedbyaddress", 2, "include_watchonly" },
{ "listreceivedbyaddress", 3, "address_filter" },
{ "listreceivedbylabel", 0, "minconf" }, { "listreceivedbylabel", 0, "minconf" },
{ "listreceivedbylabel", 1, "include_empty" }, { "listreceivedbylabel", 1, "include_empty" },
{ "listreceivedbylabel", 2, "include_watchonly" }, { "listreceivedbylabel", 2, "include_watchonly" },

View file

@ -68,6 +68,10 @@ class ReceivedByTest(BitcoinTestFramework):
res = self.nodes[1].listreceivedbyaddress(minconf=0, include_empty=True, include_watchonly=True, address_filter=addr) res = self.nodes[1].listreceivedbyaddress(minconf=0, include_empty=True, include_watchonly=True, address_filter=addr)
assert_array_result(res, {"address": addr}, expected) assert_array_result(res, {"address": addr}, expected)
assert_equal(len(res), 1) assert_equal(len(res), 1)
# Test for regression on CLI calls with address string (#14173)
cli_res = self.nodes[1].cli.listreceivedbyaddress(0, True, True, addr)
assert_array_result(cli_res, {"address": addr}, expected)
assert_equal(len(cli_res), 1)
# Error on invalid address # Error on invalid address
assert_raises_rpc_error(-4, "address_filter parameter was invalid", self.nodes[1].listreceivedbyaddress, minconf=0, include_empty=True, include_watchonly=True, address_filter="bamboozling") assert_raises_rpc_error(-4, "address_filter parameter was invalid", self.nodes[1].listreceivedbyaddress, minconf=0, include_empty=True, include_watchonly=True, address_filter="bamboozling")
# Another address receive money # Another address receive money