Two commits:
- First commit tidies up the
receivedby.pytest (and speeds it up by factor of two) - Second commit changes getreceivedbyaddress to return error if the address is not found in wallet, and adds test to
receivedby.py
Two commits:
receivedby.py test (and speeds it up by factor of two)receivedby.pyShould be included in v0.16 release notes
utACK 672fbde065df795d2d23080f2eec651c25875cb2.
Concept ACK, this makes sense, there is no reason to ever call this on an unknown (neither directly owned nor watch-only) address.
641 | @@ -642,7 +642,7 @@ UniValue getreceivedbyaddress(const JSONRPCRequest& request) 642 | throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address"); 643 | CScript scriptPubKey = GetScriptForDestination(address.Get()); 644 | if (!IsMine(*pwallet, scriptPubKey)) { 645 | - return ValueFromAmount(0); 646 | + throw JSONRPCError(RPC_WALLET_ERROR, "Address not owned by this wallet");
throw JSONRPCError(RPC_WALLET_ERROR, "Address not found in wallet");
IMO these 2 commits would do:
Cleanup receivedby.pyThrow error in getreceivedbyaddress if address is not found in walletWhere the 2nd commit adds the new error and also the corresponding test.
Otherwise tested ACK 672fbde.
reACK 828c454.
Needs rebase
Rebased
@jnewbery Needs rebase
Ping me back, so we can get this merged.
- Fix flake8 warnings
- Remove the useless get_sub_array_from_array() function
- Reduce runtime for receivedby.py by about half by only using two nodes
@MarcoFalke - apologies. I didn't realise there was a silent merge conflict. Rebased.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
utACK 5e0ba8f8cd55a5c2cea4e4e2343d7dcd52aa8fad
-----BEGIN PGP SIGNATURE-----
iQIcBAEBCgAGBQJaBzUWAAoJENLqSFDnUoslDMQQALgoBpiT9S6/rTIaOLTu1rHH
EgZIta8nFZtKL7jBE5t2hac2kC7DolgslTHcxFrblugEM2qth9eArUYbTZ+nSEQU
/8/N6rj3sQ/n1yumT3XGXLkdEI7JJNkq+mpeaw+e7iE4LwJ8rf3lZrVlbXp2vbtY
W333L8lJn8z3D5sbNJq6yXo/UgZIjM0bnkSoF4fmBhBhhI2uD4G/Vc1nIUIiSsF/
x6dUIcpAOp0/qfkqEVDKseKB2+zX3I+S1GVXxrafekvDPlcPNV5n4EXVJt6TSJP5
d5bfamzS2eDYD5YcxrvcXrty+z/T8cU/Je3ZSL5RoAiHgF/xJ+o0IjyCnERDXx5f
g5ax5nUuOhFfHd9xDukhjjyEUbgEqU7poYfT1LKeKU6jFIzE1BQl7xfbnV1tw57R
Yakj3rHgs15SGou26BxIuSazw+qT59IsmFDAzzOY0ur/iaYCvBmbsCU3UBq8YZ14
mf35nLlscDmgZhv8gMTF9OYK6y7Z7o9/JlEDZfxSo1/EYI+TG1LgiYcsTnzWN1js
L7bsZ704Pr1/XxSoILbM3t9wLeGXSRMlhfq2SWnWEfHHKFbtup06azs5pP5WCwEs
0JBc6Z6GBFCkio+fPdB/nc4LWULj6nWxRi2EFRZtWsMiJIo386RS/8+j0sKAYeHM
AG2KYNZuV4dABLTwnpO8
=CY9W
-----END PGP SIGNATURE-----