diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2021-12-21 20:15:56 +0100 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2021-12-22 20:44:44 +0100 |
commit | c27bba96723384488fb6995e21bb43969d94b0f6 (patch) | |
tree | 5778bcade1d6bc68b48cc91cc8ee0c5a82154601 /test/functional | |
parent | 887796a5ffcbafcd281b920f8d55fcb6e8347584 (diff) | |
download | bitcoin-c27bba96723384488fb6995e21bb43969d94b0f6.tar.xz |
test: check for invalid listtransactions RPC parameters
Diffstat (limited to 'test/functional')
-rwxr-xr-x | test/functional/wallet_listtransactions.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/wallet_listtransactions.py b/test/functional/wallet_listtransactions.py index 1b29d163c2..f75877f256 100755 --- a/test/functional/wallet_listtransactions.py +++ b/test/functional/wallet_listtransactions.py @@ -16,6 +16,7 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( assert_array_result, assert_equal, + assert_raises_rpc_error, ) @@ -107,6 +108,7 @@ class ListTransactionsTest(BitcoinTestFramework): self.run_rbf_opt_in_test() self.run_externally_generated_address_test() + self.run_invalid_parameters_test() def run_rbf_opt_in_test(self): """Test the opt-in-rbf flag for sent and received transactions.""" @@ -275,6 +277,13 @@ class ListTransactionsTest(BitcoinTestFramework): assert_equal(['pizza2'], self.nodes[0].getaddressinfo(addr2)['labels']) assert_equal(['pizza3'], self.nodes[0].getaddressinfo(addr3)['labels']) + def run_invalid_parameters_test(self): + self.log.info("Test listtransactions RPC parameter validity") + assert_raises_rpc_error(-8, 'Label argument must be a valid label name or "*".', self.nodes[0].listtransactions, label="") + self.nodes[0].listtransactions(label="*") + assert_raises_rpc_error(-8, "Negative count", self.nodes[0].listtransactions, count=-1) + assert_raises_rpc_error(-8, "Negative from", self.nodes[0].listtransactions, skip=-1) + if __name__ == '__main__': ListTransactionsTest().main() |