Skip to content

Commit 45173fa

Browse files
author
MarcoFalke
committed
Merge #12079: Improve prioritisetransaction test coverage
7f67dd0 [qa] Improve prioritisetransaction functional test (João Barbosa) Pull request description: Tree-SHA512: 7a5c446772069cd9ace085ae2635e1f61870c597e2216614628f4b6ebfe209b29f381a182a6f60d09f43f22bb82b59bb573b5441fa8e7b958a5fd0d5aad80d86
2 parents b3ecb7b + 7f67dd0 commit 45173fa

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/functional/prioritise_transaction.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,25 @@ def set_test_params(self):
1515
self.extra_args = [["-printpriority=1"], ["-printpriority=1"]]
1616

1717
def run_test(self):
18+
# Test `prioritisetransaction` required parameters
19+
assert_raises_rpc_error(-1, "prioritisetransaction", self.nodes[0].prioritisetransaction)
20+
assert_raises_rpc_error(-1, "prioritisetransaction", self.nodes[0].prioritisetransaction, '')
21+
assert_raises_rpc_error(-1, "prioritisetransaction", self.nodes[0].prioritisetransaction, '', 0)
22+
23+
# Test `prioritisetransaction` invalid extra parameters
24+
assert_raises_rpc_error(-1, "prioritisetransaction", self.nodes[0].prioritisetransaction, '', 0, 0, 0)
25+
26+
# Test `prioritisetransaction` invalid `txid`
27+
assert_raises_rpc_error(-1, "txid must be hexadecimal string", self.nodes[0].prioritisetransaction, txid='foo', fee_delta=0)
28+
29+
# Test `prioritisetransaction` invalid `dummy`
30+
txid = '1d1d4e24ed99057e84c3f80fd8fbec79ed9e1acee37da269356ecea000000000'
31+
assert_raises_rpc_error(-1, "JSON value is not a number as expected", self.nodes[0].prioritisetransaction, txid, 'foo', 0)
32+
assert_raises_rpc_error(-8, "Priority is no longer supported, dummy argument to prioritisetransaction must be 0.", self.nodes[0].prioritisetransaction, txid, 1, 0)
33+
34+
# Test `prioritisetransaction` invalid `fee_delta`
35+
assert_raises_rpc_error(-1, "JSON value is not an integer as expected", self.nodes[0].prioritisetransaction, txid=txid, fee_delta='foo')
36+
1837
self.txouts = gen_return_txouts()
1938
self.relayfee = self.nodes[0].getnetworkinfo()['relayfee']
2039

0 commit comments

Comments
 (0)