aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/util.py
diff options
context:
space:
mode:
authorKarl-Johan Alm <karljohan-alm@garage.co.jp>2018-02-20 13:20:36 +0900
committerKarl-Johan Alm <karljohan-alm@garage.co.jp>2018-02-20 13:21:54 +0900
commit42e1b5d9797b65d3ce13a7cbace15fbedbcd4018 (patch)
tree0ec33d72d5d4101755e4c556a6b52b9662aed2cf /test/functional/test_framework/util.py
parentdcfe218626b05204e9fbc95ba5d95ca0eb72ec9b (diff)
downloadbitcoin-42e1b5d9797b65d3ce13a7cbace15fbedbcd4018.tar.xz
[test] Round target fee to 8 decimals in assert_fee_amount
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.
Diffstat (limited to 'test/functional/test_framework/util.py')
-rw-r--r--test/functional/test_framework/util.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py
index 7fdc171332..644f2d868a 100644
--- a/test/functional/test_framework/util.py
+++ b/test/functional/test_framework/util.py
@@ -26,7 +26,7 @@ logger = logging.getLogger("TestFramework.utils")
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