mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-13 03:30:42 +02:00
Bugfix: QA: When testing setfeerate, check approximate fee range with a span able to tolerate normal signature length variation
This commit is contained in:
parent
7da90bbfc5
commit
8596fff6ac
@ -24,6 +24,7 @@ from test_framework.messages import (
|
|||||||
)
|
)
|
||||||
from test_framework.test_framework import BitcoinTestFramework
|
from test_framework.test_framework import BitcoinTestFramework
|
||||||
from test_framework.util import (
|
from test_framework.util import (
|
||||||
|
assert_approx,
|
||||||
assert_equal,
|
assert_equal,
|
||||||
assert_fee_amount,
|
assert_fee_amount,
|
||||||
assert_greater_than,
|
assert_greater_than,
|
||||||
@ -556,8 +557,10 @@ def test_setfeerate(self, rbf_node, dest_address):
|
|||||||
fee_rate = 25
|
fee_rate = 25
|
||||||
test_response(requested=fee_rate, expected=fee_rate, msg="Fee rate for transactions with this wallet successfully set to 25.000 sat/vB")
|
test_response(requested=fee_rate, expected=fee_rate, msg="Fee rate for transactions with this wallet successfully set to 25.000 sat/vB")
|
||||||
bumped_tx = rbf_node.bumpfee(rbfid)
|
bumped_tx = rbf_node.bumpfee(rbfid)
|
||||||
actual_feerate = bumped_tx["fee"] * COIN / rbf_node.getrawtransaction(bumped_tx["txid"], True)["vsize"]
|
bumped_txdetails = rbf_node.getrawtransaction(bumped_tx["txid"], True)
|
||||||
assert_greater_than(Decimal("0.01"), abs(fee_rate - actual_feerate))
|
allow_for_bytes_offset = len(bumped_txdetails['vout']) * 2 # potentially up to 2 bytes per output
|
||||||
|
actual_fee = bumped_tx["fee"] * COIN
|
||||||
|
assert_approx(actual_fee, fee_rate * bumped_txdetails['vsize'], fee_rate * allow_for_bytes_offset)
|
||||||
test_response(msg="Fee rate for transactions with this wallet successfully unset. By default, automatic fee selection will be used.")
|
test_response(msg="Fee rate for transactions with this wallet successfully unset. By default, automatic fee selection will be used.")
|
||||||
|
|
||||||
# Test setfeerate with a different -maxtxfee
|
# Test setfeerate with a different -maxtxfee
|
||||||
|
Loading…
Reference in New Issue
Block a user