Skip to content

Commit 8c33961

Browse files
committed
Merge #12486: [test] Round target fee to 8 decimals in assert_fee_amount
42e1b5d [test] Round target fee to 8 decimals in assert_fee_amount (Karl-Johan Alm) Pull request description: The output would produce arbitrary number of decimal points, sometimes resulting in 9 decimals: ``` AssertionError: Fee of 0.00000415 BTC too low! (Should be 0.000006175 BTC) ``` The above looks like the expected fee is 6175 sats when in reality it's 618. Tree-SHA512: ddbff2926a88890d6e34a58db36f0b15a917a80064be6e40e9bcbec3f05ae6202d02adcd7873733945b043fa121d4a56dd930446ec368078fe1935cbfff898ce
2 parents aae64a2 + 42e1b5d commit 8c33961

File tree

1 file changed

+1
-1
lines changed
  • test/functional/test_framework

1 file changed

+1
-1
lines changed

test/functional/test_framework/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
def assert_fee_amount(fee, tx_size, fee_per_kB):
2828
"""Assert the fee was in range"""
29-
target_fee = tx_size * fee_per_kB / 1000
29+
target_fee = round(tx_size * fee_per_kB / 1000, 8)
3030
if fee < target_fee:
3131
raise AssertionError("Fee of %s BTC too low! (Should be %s BTC)" % (str(fee), str(target_fee)))
3232
# allow the wallet's estimation to be at most 2 bytes off

0 commit comments

Comments
 (0)