Skip to content

Commit

Permalink
Merge bitcoin#29459: test: check_mempool_result negative feerate
Browse files Browse the repository at this point in the history
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
  • Loading branch information
glozow committed Mar 14, 2024
2 parents e1ce5b8 + bf264e0 commit 3d255df
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/functional/mempool_accept.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ def run_test(self):
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'}],
Expand Down

0 comments on commit 3d255df

Please sign in to comment.