Skip to content

Commit

Permalink
Update smart fee parameters to Dogecoin
Browse files Browse the repository at this point in the history
* Increase minimum bucket to minimum relay fee as of 1.14.4.
* Increase maximum bucket to pre-1.14.4 realistic maximum.
* Increase decay rate to take into account Dogecoin block rate.
* Fix functional tests:
  * feature_taproot.py
  * rpc_fundrawtransaction.py
  * rpc_psbt.py
  * rpc_rawtransaction.py
  * p2p_ibd_txrelay.py
  * wallet_abandonconflict.py
  * wallet_avoidreuse.py
  * wallet_basic.py
  * wallet_bumpfee.py
  • Loading branch information
Ross Nicoll committed Sep 18, 2021
1 parent 44a1152 commit bef0a3e
Show file tree
Hide file tree
Showing 13 changed files with 100 additions and 95 deletions.
2 changes: 1 addition & 1 deletion src/policy/fees.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ class CBlockPolicyEstimator
class FeeFilterRounder
{
private:
static constexpr double MAX_FILTER_FEERATE = 1e7;
static constexpr double MAX_FILTER_FEERATE = 1e6;
/** FEE_FILTER_SPACING is just used to provide some quantization of fee
* filter results. Historically it reused FEE_SPACING, but it is completely
* unrelated, and was made a separate constant so the two concepts are not
Expand Down
4 changes: 2 additions & 2 deletions src/test/policy_fee_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ BOOST_AUTO_TEST_CASE(FeeRounder)
BOOST_CHECK_EQUAL(fee_rounder.round(-0), 0);
BOOST_CHECK_EQUAL(fee_rounder.round(-1), 0);

// check that MAX_MONEY rounds to 9170997
BOOST_CHECK_EQUAL(fee_rounder.round(MAX_MONEY), 9170997);
// check that MAX_MONEY rounds to 931091
BOOST_CHECK_EQUAL(fee_rounder.round(MAX_MONEY), 931091);
}

BOOST_AUTO_TEST_SUITE_END()
4 changes: 2 additions & 2 deletions src/test/policyestimator_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
CTxMemPool mpool(&feeEst);
LOCK2(cs_main, mpool.cs);
TestMemPoolEntryHelper entry;
CAmount basefee(2000);
CAmount deltaFee(100);
CAmount basefee(200000);
CAmount deltaFee(10000);
std::vector<CAmount> feeV;

// Populate vectors of increasing fees
Expand Down
2 changes: 1 addition & 1 deletion test/functional/feature_fee_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def split_inputs(from_node, txins, txouts, initial_split=False):
tx.vin.append(CTxIn(COutPoint(int(prevtxout["txid"], 16), prevtxout["vout"]), b""))

half_change = satoshi_round(prevtxout["amount"] / 2)
rem_change = prevtxout["amount"] - half_change - Decimal("0.00100000")
rem_change = prevtxout["amount"] - half_change - Decimal("0.01000000")
tx.vout.append(CTxOut(int(half_change * COIN), P2SH_1))
tx.vout.append(CTxOut(int(rem_change * COIN), P2SH_2))

Expand Down
4 changes: 2 additions & 2 deletions test/functional/feature_taproot.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,8 +591,8 @@ def byte_popper(expr):
SINGLE_SIG = {"inputs": [getter("sign")]}
SIG_ADD_ZERO = {"failure": {"sign": zero_appender(default_sign)}}

DUST_LIMIT = 600
MIN_FEE = 50000
DUST_LIMIT = 12000
MIN_FEE = 1000000

# === Actual test cases ===

Expand Down
2 changes: 1 addition & 1 deletion test/functional/p2p_ibd_txrelay.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from test_framework.messages import COIN
from test_framework.test_framework import BitcoinTestFramework

MAX_FEE_FILTER = Decimal(9452957) / COIN
MAX_FEE_FILTER = Decimal(959717) / COIN
NORMAL_FEE_FILTER = Decimal(100) / COIN


Expand Down
28 changes: 14 additions & 14 deletions test/functional/rpc_fundrawtransaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ def test_locked_wallet(self):
self.nodes[1].getnewaddress()
self.nodes[1].getrawchangeaddress()
inputs = []
outputs = {self.nodes[0].getnewaddress():1.09858}
outputs = {self.nodes[0].getnewaddress():1.09885}
rawtx = self.nodes[1].createrawtransaction(inputs, outputs)
# fund a transaction that does not require a new key for the change output
self.nodes[1].fundrawtransaction(rawtx)
Expand Down Expand Up @@ -584,13 +584,13 @@ def test_many_inputs_fee(self):
self.sync_all()

for _ in range(20):
self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 0.01)
self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 0.1)
self.nodes[0].generate(1)
self.sync_all()

# Fund a tx with ~20 small inputs.
inputs = []
outputs = {self.nodes[0].getnewaddress():0.15,self.nodes[0].getnewaddress():0.04}
outputs = {self.nodes[0].getnewaddress():1.5,self.nodes[0].getnewaddress():0.4}
rawtx = self.nodes[1].createrawtransaction(inputs, outputs)
fundedTx = self.nodes[1].fundrawtransaction(rawtx)

Expand All @@ -612,7 +612,7 @@ def test_many_inputs_send(self):
self.sync_all()

for _ in range(20):
self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 0.01)
self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 0.1)
self.nodes[0].generate(1)
self.sync_all()

Expand All @@ -627,7 +627,7 @@ def test_many_inputs_send(self):
self.nodes[1].sendrawtransaction(fundedAndSignedTx['hex'])
self.nodes[1].generate(1)
self.sync_all()
assert_equal(oldBalance+Decimal('500019.00000000'), self.nodes[0].getbalance()) #0.19+block reward
assert_equal(oldBalance+Decimal('500000.1900000'), self.nodes[0].getbalance()) #1.9+block reward

def test_op_return(self):
self.log.info("Test fundrawtxn with OP_RETURN and no vin")
Expand Down Expand Up @@ -719,10 +719,10 @@ def test_option_feerate(self):

result = node.fundrawtransaction(rawtx) # uses self.min_relay_tx_fee (set by settxfee)
btc_kvb_to_sat_vb = 100000 # (1e5)
result1 = node.fundrawtransaction(rawtx, {"fee_rate": str(2 * btc_kvb_to_sat_vb * self.min_relay_tx_fee)})
result2 = node.fundrawtransaction(rawtx, {"feeRate": 2 * self.min_relay_tx_fee})
result3 = node.fundrawtransaction(rawtx, {"fee_rate": 10 * btc_kvb_to_sat_vb * self.min_relay_tx_fee})
result4 = node.fundrawtransaction(rawtx, {"feeRate": str(10 * self.min_relay_tx_fee)})
result1 = node.fundrawtransaction(rawtx, {"fee_rate": str(2 * btc_kvb_to_sat_vb * 10 * self.min_relay_tx_fee)})
result2 = node.fundrawtransaction(rawtx, {"feeRate": 2 * 10 * self.min_relay_tx_fee})
result3 = node.fundrawtransaction(rawtx, {"fee_rate": 10 * btc_kvb_to_sat_vb * 10 * self.min_relay_tx_fee})
result4 = node.fundrawtransaction(rawtx, {"feeRate": str(10 * 10 * self.min_relay_tx_fee)})
# Test that funding non-standard "zero-fee" transactions is valid.
result5 = self.nodes[3].fundrawtransaction(rawtx, {"fee_rate": 0})
result6 = self.nodes[3].fundrawtransaction(rawtx, {"feeRate": 0})
Expand All @@ -735,8 +735,8 @@ def test_option_feerate(self):
assert_fee_amount(result5['fee'], count_bytes(result5['hex']), 0)
assert_fee_amount(result6['fee'], count_bytes(result6['hex']), 0)

# With no arguments passed, expect fee of 141 satoshis.
assert_approx(node.fundrawtransaction(rawtx)["fee"], vexp=0.00000141, vspan=0.00000001)
# With no arguments passed, expect fee of 1410 koinu.
assert_approx(node.fundrawtransaction(rawtx)["fee"], vexp=0.00141, vspan=0.00001)
# Expect fee to be 10,000x higher when an explicit fee rate 10,000x greater is specified.
result = node.fundrawtransaction(rawtx, {"fee_rate": 10000})
assert_approx(result["fee"], vexp=0.0141, vspan=0.0001)
Expand All @@ -760,7 +760,7 @@ def test_option_feerate(self):
node.fundrawtransaction, rawtx, {"estimate_mode": mode, "conf_target": n, "add_inputs": True})

self.log.info("Test invalid fee rate settings")
for param, value in {("fee_rate", 100000), ("feeRate", 1.000)}:
for param, value in {("fee_rate", 10000000), ("feeRate", 100.000)}:
assert_raises_rpc_error(-4, "Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)",
node.fundrawtransaction, rawtx, {param: value, "add_inputs": True})
assert_raises_rpc_error(-3, "Amount out of range",
Expand All @@ -771,8 +771,8 @@ def test_option_feerate(self):
node.fundrawtransaction, rawtx, {param: "", "add_inputs": True})

self.log.info("Test min fee rate checks are bypassed with fundrawtxn, e.g. a fee_rate under 1 koinu/vB is allowed")
node.fundrawtransaction(rawtx, {"fee_rate": 0.99999999, "add_inputs": True})
node.fundrawtransaction(rawtx, {"feeRate": 0.00000999, "add_inputs": True})
node.fundrawtransaction(rawtx, {"fee_rate": 9.99999999, "add_inputs": True})
node.fundrawtransaction(rawtx, {"feeRate": 0.00099999, "add_inputs": True})

self.log.info("- raises RPC error if both feeRate and fee_rate are passed")
assert_raises_rpc_error(-8, "Cannot specify both fee_rate (koinu/vB) and feeRate (DOGE/kvB)",
Expand Down
10 changes: 5 additions & 5 deletions test/functional/rpc_psbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def run_test(self):
p2sh_p2wpkh = self.nodes[1].getnewaddress("", "p2sh-segwit")

# fund those addresses
rawtx = self.nodes[0].createrawtransaction([], {p2sh:10, p2wsh:10, p2wpkh:10, p2sh_p2wsh:10, p2sh_p2wpkh:10, p2pkh:10})
rawtx = self.nodes[0].createrawtransaction([], {p2sh:100, p2wsh:100, p2wpkh:100, p2sh_p2wsh:100, p2sh_p2wpkh:100, p2pkh:100})
rawtx = self.nodes[0].fundrawtransaction(rawtx, {"changePosition":3})
signed_tx = self.nodes[0].signrawtransactionwithwallet(rawtx['hex'])['hex']
txid = self.nodes[0].sendrawtransaction(signed_tx)
Expand Down Expand Up @@ -173,7 +173,7 @@ def run_test(self):
p2pkh_pos = out['n']

inputs = [{"txid": txid, "vout": p2wpkh_pos}, {"txid": txid, "vout": p2sh_p2wpkh_pos}, {"txid": txid, "vout": p2pkh_pos}]
outputs = [{self.nodes[1].getnewaddress(): 29.99}]
outputs = [{self.nodes[1].getnewaddress(): 299.99}]

# spend single key from node 1
created_psbt = self.nodes[1].walletcreatefundedpsbt(inputs, outputs)
Expand Down Expand Up @@ -204,7 +204,7 @@ def run_test(self):
assert_equal(self.nodes[1].walletcreatefundedpsbt(inputs, outputs, 0, {param: 0, "add_inputs": True})["fee"], 0)

self.log.info("Test invalid fee rate settings")
for param, value in {("fee_rate", 100000), ("feeRate", 1)}:
for param, value in {("fee_rate", 10000000), ("feeRate", 100)}:
assert_raises_rpc_error(-4, "Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)",
self.nodes[1].walletcreatefundedpsbt, inputs, outputs, 0, {param: value, "add_inputs": True})
assert_raises_rpc_error(-3, "Amount out of range",
Expand Down Expand Up @@ -254,8 +254,8 @@ def run_test(self):
# previously this was silently capped at -maxtxfee
for bool_add, outputs_array in {True: outputs, False: [{self.nodes[1].getnewaddress(): 1}]}.items():
msg = "Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)"
assert_raises_rpc_error(-4, msg, self.nodes[1].walletcreatefundedpsbt, inputs, outputs_array, 0, {"fee_rate": 1000000, "add_inputs": bool_add})
assert_raises_rpc_error(-4, msg, self.nodes[1].walletcreatefundedpsbt, inputs, outputs_array, 0, {"feeRate": 1, "add_inputs": bool_add})
assert_raises_rpc_error(-4, msg, self.nodes[1].walletcreatefundedpsbt, inputs, outputs_array, 0, {"fee_rate": 10000000, "add_inputs": bool_add})
assert_raises_rpc_error(-4, msg, self.nodes[1].walletcreatefundedpsbt, inputs, outputs_array, 0, {"feeRate": 100, "add_inputs": bool_add})

self.log.info("Test various PSBT operations")
# partially sign multisig things with node 1
Expand Down
25 changes: 13 additions & 12 deletions test/functional/rpc_rawtransaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from test_framework.util import (
assert_equal,
assert_raises_rpc_error,
count_bytes,
find_vout_for_address,
hex_str_to_bytes,
)
Expand Down Expand Up @@ -462,18 +463,18 @@ def run_test(self):
self.log.info('sendrawtransaction/testmempoolaccept with maxfeerate')

# Test a transaction with a small fee.
txId = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 1.0)
txId = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 10.0)
rawTx = self.nodes[0].getrawtransaction(txId, True)
vout = next(o for o in rawTx['vout'] if o['value'] == Decimal('1.00000000'))
vout = next(o for o in rawTx['vout'] if o['value'] == Decimal('10.00000000'))

self.sync_all()
inputs = [{ "txid" : txId, "vout" : vout['n'] }]
# Fee 10,000 satoshis, (1 - (10000 sat * 0.00000001 BTC/sat)) = 0.9999
outputs = { self.nodes[0].getnewaddress() : Decimal("0.99990000") }
# Fee 1 DOGE, 10 - 1 = 9 DOGE
outputs = { self.nodes[0].getnewaddress() : Decimal("9.000") }
rawTx = self.nodes[2].createrawtransaction(inputs, outputs)
rawTxSigned = self.nodes[2].signrawtransactionwithwallet(rawTx)
assert_equal(rawTxSigned['complete'], True)
# Fee 10,000 satoshis, ~100 b transaction, fee rate should land around 100 sat/byte = 0.00100000 BTC/kB
# Fee 1 DOGE, ~100 b transaction, fee rate should land around 10 DOGE/kB
# Thus, testmempoolaccept should reject
testres = self.nodes[2].testmempoolaccept([rawTxSigned['hex']], 1.00000000)[0]
assert_equal(testres['allowed'], False)
Expand All @@ -486,28 +487,28 @@ def run_test(self):
self.nodes[2].sendrawtransaction(hexstring=rawTxSigned['hex'])

# Test a transaction with a large fee.
txId = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 1.0)
txId = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 100.0)
rawTx = self.nodes[0].getrawtransaction(txId, True)
vout = next(o for o in rawTx['vout'] if o['value'] == Decimal('1.00000000'))
vout = next(o for o in rawTx['vout'] if o['value'] == Decimal('100.00000000'))

self.sync_all()
inputs = [{ "txid" : txId, "vout" : vout['n'] }]
# Fee 2,000,000 satoshis, (1 - (2000000 sat * 0.00000001 BTC/sat)) = 0.98
outputs = { self.nodes[0].getnewaddress() : Decimal("0.98000000") }
# Fee 2 DOGE
outputs = { self.nodes[0].getnewaddress() : Decimal("98.00000000") }
rawTx = self.nodes[2].createrawtransaction(inputs, outputs)
rawTxSigned = self.nodes[2].signrawtransactionwithwallet(rawTx)
assert_equal(rawTxSigned['complete'], True)
# Fee 2,000,000 satoshis, ~100 b transaction, fee rate should land around 20,000 sat/byte = 0.20000000 BTC/kB
# Fee 2 DOGE, ~200 b transaction, fee rate should land around 11 DOGE/kB
# Thus, testmempoolaccept should reject
testres = self.nodes[2].testmempoolaccept([rawTxSigned['hex']])[0]
assert_equal(testres['allowed'], False)
assert_equal(testres['reject-reason'], 'max-fee-exceeded')
# and sendrawtransaction should throw
assert_raises_rpc_error(-25, 'Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)', self.nodes[2].sendrawtransaction, rawTxSigned['hex'])
# and the following calls should both succeed
testres = self.nodes[2].testmempoolaccept(rawtxs=[rawTxSigned['hex']], maxfeerate='0.20000000')[0]
testres = self.nodes[2].testmempoolaccept(rawtxs=[rawTxSigned['hex']], maxfeerate='20.00000000')[0]
assert_equal(testres['allowed'], True)
self.nodes[2].sendrawtransaction(hexstring=rawTxSigned['hex'], maxfeerate='0.20000000')
self.nodes[2].sendrawtransaction(hexstring=rawTxSigned['hex'], maxfeerate='20.00000000')


if __name__ == '__main__':
Expand Down
26 changes: 13 additions & 13 deletions test/functional/wallet_abandonconflict.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def run_test(self):
# Disconnect nodes so node0's transactions don't get into node1's mempool
self.disconnect_nodes(0, 1)

# Identify the 10btc outputs
# Identify the 10DOGE outputs
nA = next(tx_out["vout"] for tx_out in self.nodes[0].gettransaction(txA)["details"] if tx_out["amount"] == Decimal("10"))
nB = next(tx_out["vout"] for tx_out in self.nodes[0].gettransaction(txB)["details"] if tx_out["amount"] == Decimal("10"))
nC = next(tx_out["vout"] for tx_out in self.nodes[0].gettransaction(txC)["details"] if tx_out["amount"] == Decimal("10"))
Expand All @@ -61,25 +61,25 @@ def run_test(self):
inputs.append({"txid": txB, "vout": nB})
outputs = {}

outputs[self.nodes[0].getnewaddress()] = Decimal("14.99998")
outputs[self.nodes[0].getnewaddress()] = Decimal("14.998")
outputs[self.nodes[1].getnewaddress()] = Decimal("5")
signed = self.nodes[0].signrawtransactionwithwallet(self.nodes[0].createrawtransaction(inputs, outputs))
txAB1 = self.nodes[0].sendrawtransaction(signed["hex"])

# Identify the 14.99998btc output
nAB = next(tx_out["vout"] for tx_out in self.nodes[0].gettransaction(txAB1)["details"] if tx_out["amount"] == Decimal("14.99998"))
# Identify the 14.998DOGE output
nAB = next(tx_out["vout"] for tx_out in self.nodes[0].gettransaction(txAB1)["details"] if tx_out["amount"] == Decimal("14.998"))

#Create a child tx spending AB1 and C
inputs = []
inputs.append({"txid": txAB1, "vout": nAB})
inputs.append({"txid": txC, "vout": nC})
outputs = {}
outputs[self.nodes[0].getnewaddress()] = Decimal("24.9996")
outputs[self.nodes[0].getnewaddress()] = Decimal("24.96")
signed2 = self.nodes[0].signrawtransactionwithwallet(self.nodes[0].createrawtransaction(inputs, outputs))
txABC2 = self.nodes[0].sendrawtransaction(signed2["hex"])

# Create a child tx spending ABC2
signed3_change = Decimal("24.999")
signed3_change = Decimal("24.9")
inputs = [{"txid": txABC2, "vout": 0}]
outputs = {self.nodes[0].getnewaddress(): signed3_change}
signed3 = self.nodes[0].signrawtransactionwithwallet(self.nodes[0].createrawtransaction(inputs, outputs))
Expand All @@ -93,7 +93,7 @@ def run_test(self):

# Restart the node with a higher min relay fee so the parent tx is no longer in mempool
# TODO: redo with eviction
self.restart_node(0, extra_args=["-minrelaytxfee=0.0001"])
self.restart_node(0, extra_args=["-minrelaytxfee=0.01"])
assert self.nodes[0].getmempoolinfo()['loaded']

# Verify txs no longer in either node's mempool
Expand All @@ -120,7 +120,7 @@ def run_test(self):
balance = newbalance

# Verify that even with a low min relay fee, the tx is not reaccepted from wallet on startup once abandoned
self.restart_node(0, extra_args=["-minrelaytxfee=0.00001"])
self.restart_node(0, extra_args=["-minrelaytxfee=0.001"])
assert self.nodes[0].getmempoolinfo()['loaded']

assert_equal(len(self.nodes[0].getrawmempool()), 0)
Expand All @@ -131,29 +131,29 @@ def run_test(self):
# But its child tx remains abandoned
self.nodes[0].sendrawtransaction(signed["hex"])
newbalance = self.nodes[0].getbalance()
assert_equal(newbalance, balance - Decimal("20") + Decimal("14.99998"))
assert_equal(newbalance, balance - Decimal("20") + Decimal("14.998"))
balance = newbalance

# Send child tx again so it is unabandoned
self.nodes[0].sendrawtransaction(signed2["hex"])
newbalance = self.nodes[0].getbalance()
assert_equal(newbalance, balance - Decimal("10") - Decimal("14.99998") + Decimal("24.9996"))
assert_equal(newbalance, balance - Decimal("10") - Decimal("14.998") + Decimal("24.96"))
balance = newbalance

# Remove using high relay fee again
self.restart_node(0, extra_args=["-minrelaytxfee=0.0001"])
self.restart_node(0, extra_args=["-minrelaytxfee=0.01"])
assert self.nodes[0].getmempoolinfo()['loaded']
assert_equal(len(self.nodes[0].getrawmempool()), 0)
newbalance = self.nodes[0].getbalance()
assert_equal(newbalance, balance - Decimal("24.9996"))
assert_equal(newbalance, balance - Decimal("24.96"))
balance = newbalance

# Create a double spend of AB1 by spending again from only A's 10 output
# Mine double spend from node 1
inputs = []
inputs.append({"txid": txA, "vout": nA})
outputs = {}
outputs[self.nodes[1].getnewaddress()] = Decimal("9.9999")
outputs[self.nodes[1].getnewaddress()] = Decimal("9")
tx = self.nodes[0].createrawtransaction(inputs, outputs)
signed = self.nodes[0].signrawtransactionwithwallet(tx)
self.nodes[1].sendrawtransaction(signed["hex"])
Expand Down
6 changes: 3 additions & 3 deletions test/functional/wallet_avoidreuse.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ def assert_unspent(node, total_count=None, total_sum=None, reused_supported=None
if total_count is not None:
assert_equal(stats["total"]["count"], total_count)
if total_sum is not None:
assert_approx(stats["total"]["sum"], total_sum, 0.001)
assert_approx(stats["total"]["sum"], total_sum, 0.01)
if reused_supported is not None:
assert_equal(stats["reused"]["supported"], reused_supported)
if reused_count is not None:
assert_equal(stats["reused"]["count"], reused_count)
if reused_sum is not None:
assert_approx(stats["reused"]["sum"], reused_sum, 0.001)
assert_approx(stats["reused"]["sum"], reused_sum, 0.01)

def assert_balances(node, mine):
'''Make assertions about a node's getbalances output'''
got = node.getbalances()["mine"]
for k,v in mine.items():
assert_approx(got[k], v, 0.001)
assert_approx(got[k], v, 0.01)

class AvoidReuseTest(BitcoinTestFramework):

Expand Down
Loading

0 comments on commit bef0a3e

Please sign in to comment.