From bf264e05981e3809715f34f548138d53991db6f2 Mon Sep 17 00:00:00 2001 From: kevkevin Date: Tue, 20 Feb 2024 21:13:48 -0600 Subject: test: check_mempool_result negative feerate Adds test in mempool_accept to check if a negative maxfeerate is inputed into check_mempool_result, asserts "Amount out of range" error message and -3 error code --- test/functional/mempool_accept.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/functional/mempool_accept.py b/test/functional/mempool_accept.py index 538e1fe053..272e932fcc 100755 --- a/test/functional/mempool_accept.py +++ b/test/functional/mempool_accept.py @@ -96,6 +96,12 @@ class MempoolAcceptanceTest(BitcoinTestFramework): rawtxs=[raw_tx_in_block], maxfeerate=1, )) + # Check negative feerate + assert_raises_rpc_error(-3, "Amount out of range", lambda: self.check_mempool_result( + result_expected=None, + rawtxs=[raw_tx_in_block], + maxfeerate=-0.01, + )) # ... 0.99 passes self.check_mempool_result( result_expected=[{'txid': txid_in_block, 'allowed': False, 'reject-reason': 'txn-already-known'}], -- cgit v1.2.3