diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-10-06 15:19:34 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-10-06 15:16:59 +0200 |
commit | fa2ac5881edf8d0d3f15c43f089f1831348dfae2 (patch) | |
tree | 394995de99764ede38e30b9c1c7161bd19f98354 /test/functional/mempool_packages.py | |
parent | 66d11b14357c474416181227e197406ca8fb5dee (diff) | |
download | bitcoin-fa2ac5881edf8d0d3f15c43f089f1831348dfae2.tar.xz |
test: Replace satoshi_round with int() or Decimal()
satoshi_round will round down. To make the code easier to parse use
Decimal() where possible, which does not round. Or use int(), which
explicitly rounds down.
Diffstat (limited to 'test/functional/mempool_packages.py')
-rwxr-xr-x | test/functional/mempool_packages.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/test/functional/mempool_packages.py b/test/functional/mempool_packages.py index c042961937..3943bba489 100755 --- a/test/functional/mempool_packages.py +++ b/test/functional/mempool_packages.py @@ -14,7 +14,6 @@ from test_framework.util import ( assert_equal, assert_raises_rpc_error, chain_transaction, - satoshi_round, ) # default limits @@ -209,10 +208,10 @@ class MempoolPackagesTest(BitcoinTestFramework): entry = self.nodes[0].getmempoolentry(x) descendant_fees += entry['fee'] if (x == chain[-1]): - assert_equal(entry['modifiedfee'], entry['fee']+satoshi_round(0.00002)) - assert_equal(entry['fees']['modified'], entry['fee']+satoshi_round(0.00002)) + assert_equal(entry['modifiedfee'], entry['fee'] + Decimal("0.00002")) + assert_equal(entry['fees']['modified'], entry['fee'] + Decimal("0.00002")) assert_equal(entry['descendantfees'], descendant_fees * COIN + 2000) - assert_equal(entry['fees']['descendant'], descendant_fees+satoshi_round(0.00002)) + assert_equal(entry['fees']['descendant'], descendant_fees + Decimal("0.00002")) # Check that node1's mempool is as expected (-> custom ancestor limit) mempool0 = self.nodes[0].getrawmempool(False) @@ -308,7 +307,7 @@ class MempoolPackagesTest(BitcoinTestFramework): value = utxo[0]['amount'] vout = utxo[0]['vout'] - send_value = satoshi_round((value - fee)/2) + send_value = (value - fee) / 2 inputs = [ {'txid' : txid, 'vout' : vout} ] outputs = {} for _ in range(2): |