Skip to content

Commit

Permalink
Add rounding helper function to util.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sdaftuar authored and laanwj committed Dec 1, 2015
1 parent 8f761e8 commit 6e8b07f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 0 additions & 3 deletions qa/rpc-tests/mempool_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 0 additions & 3 deletions qa/rpc-tests/smartfees.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
# 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.
Expand Down
3 changes: 3 additions & 0 deletions qa/rpc-tests/test_framework/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 6e8b07f

Please sign in to comment.