diff options
author | Ava Chow <github@achow101.com> | 2024-09-04 13:26:57 -0400 |
---|---|---|
committer | Ava Chow <github@achow101.com> | 2024-09-04 13:26:57 -0400 |
commit | 210210c923187f914cad5ddcf719c65dde225438 (patch) | |
tree | bbe0604310a7be0e91eac19bb85ddd1c0bf0cb71 /test/functional/feature_fee_estimation.py | |
parent | b0c3de684795f7f5e54b59e810d1bc57433d476e (diff) | |
parent | ec317bc44b0cb089419d809b5fef38ecb9423051 (diff) |
Merge bitcoin/bitcoin#29566: test: update satoshi_round function
ec317bc44b0cb089419d809b5fef38ecb9423051 test: update satoshi_round function (naiyoma)
Pull request description:
This PR refactors `satoshi_round` to accept different rounding modes and make rounding a required argument.
Continuation of https://github.com/bitcoin/bitcoin/pull/23225
ACKs for top commit:
maflcko:
review ACK ec317bc44b0cb089419d809b5fef38ecb9423051
achow101:
ACK ec317bc44b0cb089419d809b5fef38ecb9423051
AngusP:
ACK ec317bc44b0cb089419d809b5fef38ecb9423051
Tree-SHA512: 070f0aa6f66e58bff7412cae6b71f5f4ab8c718c7b5eeba4bb604fe22c6416a1ced0474294f504e1c28943ddc073104466b5944b43bae27e42bee5ca85afa468
Diffstat (limited to 'test/functional/feature_fee_estimation.py')
-rwxr-xr-x | test/functional/feature_fee_estimation.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/functional/feature_fee_estimation.py b/test/functional/feature_fee_estimation.py index a3dcb7afda..83627ff5c2 100755 --- a/test/functional/feature_fee_estimation.py +++ b/test/functional/feature_fee_estimation.py @@ -4,7 +4,7 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test fee estimation code.""" from copy import deepcopy -from decimal import Decimal +from decimal import Decimal, ROUND_DOWN import os import random import time @@ -40,7 +40,7 @@ def small_txpuzzle_randfee( # Exponentially distributed from 1-128 * fee_increment rand_fee = float(fee_increment) * (1.1892 ** random.randint(0, 28)) # Total fee ranges from min_fee to min_fee + 127*fee_increment - fee = min_fee - fee_increment + satoshi_round(rand_fee) + fee = min_fee - fee_increment + satoshi_round(rand_fee, rounding=ROUND_DOWN) utxos_to_spend = [] total_in = Decimal("0.00000000") while total_in <= (amount + fee) and len(conflist) > 0: |