aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2019-02-25 09:29:50 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2019-02-25 09:31:08 +0100
commit1a8a5ede9fc334bd97b774670eb340b8665a0aa4 (patch)
treec3449c48d35f665b8de6da0888e87e2b8a6e62b7 /test
parentf3f9c1de19e6d254e0c3a26ce7a3d8cd57fb7641 (diff)
parentfa4ce7038d444defe0b98a30097174c278054a33 (diff)
downloadbitcoin-1a8a5ede9fc334bd97b774670eb340b8665a0aa4.tar.xz
Merge #15401: rpc: Actually throw help when passed invalid number of params
fa4ce7038d444defe0b98a30097174c278054a33 rpc: Actually throw help when passed invalid number of params (MarcoFalke) fa05626ca7a0fe896ac554c79eaea4c36acdf861 rpc: Add RPCHelpMan::IsValidNumArgs() (MarcoFalke) Pull request description: Can be tested by * running the included test against an old binary (compiled without this patch) * calling `setban 1 "add" 3 4 5 6 7 8 9 0` in the gui Tree-SHA512: aa6a25bbe6f40722913ea292252a62a4012c964eed9f4035335a2e2d13be98eb60f368e8a3251a104a26a62c08b2cb926b06e5ab1418ef1cf4abdd71d87c2919
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/rpc_getblockstats.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/functional/rpc_getblockstats.py b/test/functional/rpc_getblockstats.py
index ca9e24367a..feba16f1b3 100755
--- a/test/functional/rpc_getblockstats.py
+++ b/test/functional/rpc_getblockstats.py
@@ -178,5 +178,10 @@ class GetblockstatsTest(BitcoinTestFramework):
assert_raises_rpc_error(-5, 'Block not found', self.nodes[0].getblockstats,
hash_or_height='000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f')
+ # Invalid number of args
+ assert_raises_rpc_error(-1, 'getblockstats hash_or_height ( stats )', self.nodes[0].getblockstats, '00', 1, 2)
+ assert_raises_rpc_error(-1, 'getblockstats hash_or_height ( stats )', self.nodes[0].getblockstats)
+
+
if __name__ == '__main__':
GetblockstatsTest().main()