diff options
author | Suhas Daftuar <sdaftuar@chaincode.com> | 2015-11-18 18:35:07 -0500 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-12-01 11:03:37 +0100 |
commit | 6e8b07f5f3117d1346e2e720c61ba3e8b08f7cd8 (patch) | |
tree | 97b2e8da9f8c270c9508a993b08fc92a6528d0de /qa | |
parent | 8f761e87c3fd0ad50d41925d8c2ac2c429403b44 (diff) |
Add rounding helper function to util.py
Diffstat (limited to 'qa')
-rwxr-xr-x | qa/rpc-tests/mempool_packages.py | 3 | ||||
-rwxr-xr-x | qa/rpc-tests/smartfees.py | 3 | ||||
-rw-r--r-- | qa/rpc-tests/test_framework/util.py | 3 |
3 files changed, 3 insertions, 6 deletions
diff --git a/qa/rpc-tests/mempool_packages.py b/qa/rpc-tests/mempool_packages.py index 746c26ff5e..34b316a6a3 100755 --- a/qa/rpc-tests/mempool_packages.py +++ b/qa/rpc-tests/mempool_packages.py @@ -8,9 +8,6 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * -def satoshi_round(amount): - return Decimal(amount).quantize(Decimal('0.00000001'), rounding=ROUND_DOWN) - MAX_ANCESTORS = 25 MAX_DESCENDANTS = 25 diff --git a/qa/rpc-tests/smartfees.py b/qa/rpc-tests/smartfees.py index ecfffc1b45..b209ae0c16 100755 --- a/qa/rpc-tests/smartfees.py +++ b/qa/rpc-tests/smartfees.py @@ -19,9 +19,6 @@ P2SH_2 = "2NBdpwq8Aoo1EEKEXPNrKvr5xQr3M9UfcZA" # P2SH of "OP_2 OP_DROP" # 4 bytes of OP_TRUE and push 2-byte redeem script of "OP_1 OP_DROP" or "OP_2 OP_DROP" SCRIPT_SIG = ["0451025175", "0451025275"] -def satoshi_round(amount): - return Decimal(amount).quantize(Decimal('0.00000001'), rounding=ROUND_DOWN) - def small_txpuzzle_randfee(from_node, conflist, unconflist, amount, min_fee, fee_increment): ''' Create and send a transaction with a random fee. diff --git a/qa/rpc-tests/test_framework/util.py b/qa/rpc-tests/test_framework/util.py index d9d5129f21..1a526ae06e 100644 --- a/qa/rpc-tests/test_framework/util.py +++ b/qa/rpc-tests/test_framework/util.py @@ -404,3 +404,6 @@ def assert_raises(exc, fun, *args, **kwds): raise AssertionError("Unexpected exception raised: "+type(e).__name__) else: raise AssertionError("No exception raised") + +def satoshi_round(amount): + return Decimal(amount).quantize(Decimal('0.00000001'), rounding=ROUND_DOWN) |