Skip to content

Commit b812959

Browse files
committed
QA: rpc_rawtransaction: Test ignore_rejects
1 parent fee096b commit b812959

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/functional/rpc_rawtransaction.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,12 +409,22 @@ def sendrawtransaction_testmempoolaccept_tests(self):
409409
testres = self.nodes[2].testmempoolaccept([tx['hex']], 0.00001000)[0]
410410
assert_equal(testres['allowed'], False)
411411
assert_equal(testres['reject-reason'], 'max-fee-exceeded')
412+
testres = self.nodes[2].testmempoolaccept([tx['hex']], 0.00001000, ['foobar'])[0]
413+
assert_equal(testres['allowed'], False)
414+
assert_equal(testres['reject-reason'], 'max-fee-exceeded')
415+
# unless ignored explicitly
416+
testres = self.nodes[2].testmempoolaccept([tx['hex']], 0.00001000, ['max-fee-exceeded'])[0]
417+
assert_equal(testres['allowed'], True)
418+
assert('reject-reason' not in testres)
419+
testres = self.nodes[2].testmempoolaccept([tx['hex']], 0.00001000, ['absurdly-high-fee'])[0]
420+
assert_equal(testres['allowed'], True)
421+
assert('reject-reason' not in testres)
412422
# and sendrawtransaction should throw
413423
assert_raises_rpc_error(-25, fee_exceeds_max, self.nodes[2].sendrawtransaction, tx['hex'], 0.00001000)
414424
# and the following calls should both succeed
415425
testres = self.nodes[2].testmempoolaccept(rawtxs=[tx['hex']])[0]
416426
assert_equal(testres['allowed'], True)
417-
self.nodes[2].sendrawtransaction(hexstring=tx['hex'])
427+
self.nodes[2].sendrawtransaction(hexstring=tx['hex'], maxfeerate=0.00001000, ignore_rejects=['max-fee-exceeded'])
418428

419429
# Test a transaction with a large fee.
420430
# Fee rate is 0.20000000 BTC/kvB

0 commit comments

Comments
 (0)