|
16 | 16 | from test_framework.util import (
|
17 | 17 | assert_array_result,
|
18 | 18 | assert_equal,
|
| 19 | + assert_raises_rpc_error, |
19 | 20 | )
|
20 | 21 |
|
21 | 22 |
|
@@ -107,6 +108,7 @@ def run_test(self):
|
107 | 108 |
|
108 | 109 | self.run_rbf_opt_in_test()
|
109 | 110 | self.run_externally_generated_address_test()
|
| 111 | + self.run_invalid_parameters_test() |
110 | 112 |
|
111 | 113 | def run_rbf_opt_in_test(self):
|
112 | 114 | """Test the opt-in-rbf flag for sent and received transactions."""
|
@@ -275,6 +277,13 @@ def normalize_list(txs):
|
275 | 277 | assert_equal(['pizza2'], self.nodes[0].getaddressinfo(addr2)['labels'])
|
276 | 278 | assert_equal(['pizza3'], self.nodes[0].getaddressinfo(addr3)['labels'])
|
277 | 279 |
|
| 280 | + def run_invalid_parameters_test(self): |
| 281 | + self.log.info("Test listtransactions RPC parameter validity") |
| 282 | + assert_raises_rpc_error(-8, 'Label argument must be a valid label name or "*".', self.nodes[0].listtransactions, label="") |
| 283 | + self.nodes[0].listtransactions(label="*") |
| 284 | + assert_raises_rpc_error(-8, "Negative count", self.nodes[0].listtransactions, count=-1) |
| 285 | + assert_raises_rpc_error(-8, "Negative from", self.nodes[0].listtransactions, skip=-1) |
| 286 | + |
278 | 287 |
|
279 | 288 | if __name__ == '__main__':
|
280 | 289 | ListTransactionsTest().main()
|
0 commit comments