diff options
| author | Wladimir J. van der Laan <[email protected]> | 2018-02-23 17:01:33 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2018-02-23 17:07:27 +0100 |
| commit | 8c33961313d9a6fd9e6e14f136057468a929b3e1 (patch) | |
| tree | 5a88cc9d7394fdb8819150dad28625f804917cf5 | |
| parent | Merge #12451: Bump leveldb subtree (diff) | |
| parent | [test] Round target fee to 8 decimals in assert_fee_amount (diff) | |
| download | discoin-8c33961313d9a6fd9e6e14f136057468a929b3e1.tar.xz discoin-8c33961313d9a6fd9e6e14f136057468a929b3e1.zip | |
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
| -rw-r--r-- | test/functional/test_framework/util.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index 34a21ff8f..4fe586b84 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 |