aboutsummaryrefslogtreecommitdiff
path: root/test/functional/wallet_avoidreuse.py
diff options
context:
space:
mode:
authorfridokus <[email protected]>2019-09-19 14:53:40 +0200
committerfridokus <[email protected]>2019-09-19 14:53:40 +0200
commit96299a9d6c0a6b9125a58a63ee3147e55d1b086b (patch)
tree67a67bd03567613ba1c6d1afc837e08e32375d44 /test/functional/wallet_avoidreuse.py
parentMerge #16885: doc: Update tx-size-small comment with relevant CVE disclosure (diff)
downloaddiscoin-96299a9d6c0a6b9125a58a63ee3147e55d1b086b.tar.xz
discoin-96299a9d6c0a6b9125a58a63ee3147e55d1b086b.zip
Test: Move common function assert_approx() into util.py
Diffstat (limited to 'test/functional/wallet_avoidreuse.py')
-rwxr-xr-xtest/functional/wallet_avoidreuse.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/test/functional/wallet_avoidreuse.py b/test/functional/wallet_avoidreuse.py
index e3aa6705e..3c8064ea2 100755
--- a/test/functional/wallet_avoidreuse.py
+++ b/test/functional/wallet_avoidreuse.py
@@ -6,18 +6,12 @@
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
+ assert_approx,
assert_equal,
assert_raises_rpc_error,
connect_nodes,
)
-# TODO: Copied from wallet_groups.py -- should perhaps move into util.py
-def assert_approx(v, vexp, vspan=0.00001):
- if v < vexp - vspan:
- raise AssertionError("%s < [%s..%s]" % (str(v), str(vexp - vspan), str(vexp + vspan)))
- if v > vexp + vspan:
- raise AssertionError("%s > [%s..%s]" % (str(v), str(vexp - vspan), str(vexp + vspan)))
-
def reset_balance(node, discardaddr):
'''Throw away all owned coins by the node so it gets a balance of 0.'''
balance = node.getbalance(avoid_reuse=False)