Skip to content

Commit 6e8b07f

Browse files
sdaftuarlaanwj
authored andcommitted
Add rounding helper function to util.py
1 parent 8f761e8 commit 6e8b07f

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

qa/rpc-tests/mempool_packages.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
from test_framework.test_framework import BitcoinTestFramework
99
from test_framework.util import *
1010

11-
def satoshi_round(amount):
12-
return Decimal(amount).quantize(Decimal('0.00000001'), rounding=ROUND_DOWN)
13-
1411
MAX_ANCESTORS = 25
1512
MAX_DESCENDANTS = 25
1613

qa/rpc-tests/smartfees.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
# 4 bytes of OP_TRUE and push 2-byte redeem script of "OP_1 OP_DROP" or "OP_2 OP_DROP"
2020
SCRIPT_SIG = ["0451025175", "0451025275"]
2121

22-
def satoshi_round(amount):
23-
return Decimal(amount).quantize(Decimal('0.00000001'), rounding=ROUND_DOWN)
24-
2522
def small_txpuzzle_randfee(from_node, conflist, unconflist, amount, min_fee, fee_increment):
2623
'''
2724
Create and send a transaction with a random fee.

qa/rpc-tests/test_framework/util.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,3 +404,6 @@ def assert_raises(exc, fun, *args, **kwds):
404404
raise AssertionError("Unexpected exception raised: "+type(e).__name__)
405405
else:
406406
raise AssertionError("No exception raised")
407+
408+
def satoshi_round(amount):
409+
return Decimal(amount).quantize(Decimal('0.00000001'), rounding=ROUND_DOWN)

0 commit comments

Comments
 (0)