diff options
author | glozow <gloriajzhao@gmail.com> | 2024-03-14 11:14:56 +0000 |
---|---|---|
committer | glozow <gloriajzhao@gmail.com> | 2024-03-14 11:16:50 +0000 |
commit | 3d255dfb67aede71ed39aaa54f4bcad550910cb7 (patch) | |
tree | 32f4b2f46a2d968a926b7c3e9fc886ee245b7814 | |
parent | e1ce5b8ae9124717c00dca71a5c5b43a7f5ad177 (diff) | |
parent | bf264e05981e3809715f34f548138d53991db6f2 (diff) |
Merge bitcoin/bitcoin#29459: test: check_mempool_result negative feerate
bf264e05981e3809715f34f548138d53991db6f2 test: check_mempool_result negative feerate (kevkevin)
Pull request description:
Adds test coverage in `mempool_accept.py` to check if a negative `maxfeerate` is input into `check_mempool_result`
Asserts "Amount out of range" error message and `-3` error code
Motivated by this [comment](https://github.com/bitcoin/bitcoin/pull/29434/files#r1491112250)
ACKs for top commit:
maflcko:
lgtm ACK bf264e05981e3809715f34f548138d53991db6f2
brunoerg:
nice, utACK bf264e05981e3809715f34f548138d53991db6f2
davidgumberg:
Looks great, ACK https://github.com/bitcoin/bitcoin/pull/29459/commits/bf264e05981e3809715f34f548138d53991db6f2
Tree-SHA512: 58931b774cc887c616f2fd91af3ee65cc5db55acd8e2875c76de448c80bd4e020b057c5f4f85556431377f0d0e7553771fb285d1ec20cf64f64ec92a47776b78
-rwxr-xr-x | test/functional/mempool_accept.py | 6 |
1 files changed, 6 insertions, 0 deletions
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'}], |