Skip to content

Commit 086d42e

Browse files
glozowvijaydasmp
authored andcommitted
Merge bitcoin#29459: test: check_mempool_result negative feerate
bf264e0 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 bf264e0 brunoerg: nice, utACK bf264e0 davidgumberg: Looks great, ACK bitcoin@bf264e0 Tree-SHA512: 58931b774cc887c616f2fd91af3ee65cc5db55acd8e2875c76de448c80bd4e020b057c5f4f85556431377f0d0e7553771fb285d1ec20cf64f64ec92a47776b78
1 parent 737bd9d commit 086d42e

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

test/functional/mempool_accept.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ def run_test(self):
7777
txid_in_block = self.wallet.sendrawtransaction(from_node=node, tx_hex=raw_tx_in_block)
7878
self.generate(node, 1)
7979
self.mempool_size = 0
80+
# Check negative feerate
81+
assert_raises_rpc_error(-3, "Amount out of range", lambda: self.check_mempool_result(
82+
result_expected=None,
83+
rawtxs=[raw_tx_in_block],
84+
maxfeerate=-0.01,
85+
))
8086
self.check_mempool_result(
8187
result_expected=[{'txid': txid_in_block, 'allowed': False, 'reject-reason': 'txn-already-known'}],
8288
rawtxs=[raw_tx_in_block],

0 commit comments

Comments
 (0)