Skip to content

Commit

Permalink
[test] Round target fee to 8 decimals in assert_fee_amount
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kallewoof committed Feb 20, 2018
1 parent dcfe218 commit 42e1b5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/functional/test_framework/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

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

0 comments on commit 42e1b5d

Please sign in to comment.