aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/test_framework/util.py')
-rw-r--r--test/functional/test_framework/util.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py
index 7fdc171332..e9e7bbd8e4 100644
--- a/test/functional/test_framework/util.py
+++ b/test/functional/test_framework/util.py
@@ -26,7 +26,7 @@ logger = logging.getLogger("TestFramework.utils")
def assert_fee_amount(fee, tx_size, fee_per_kB):
"""Assert the fee was in range"""
- target_fee = tx_size * fee_per_kB / 1000
+ target_fee = round(tx_size * fee_per_kB / 1000, 8)
if fee < target_fee:
raise AssertionError("Fee of %s BTC too low! (Should be %s BTC)" % (str(fee), str(target_fee)))
# allow the wallet's estimation to be at most 2 bytes off
@@ -291,6 +291,9 @@ def initialize_datadir(dirname, n):
f.write("regtest=1\n")
f.write("port=" + str(p2p_port(n)) + "\n")
f.write("rpcport=" + str(rpc_port(n)) + "\n")
+ f.write("server=1\n")
+ f.write("keypool=1\n")
+ f.write("discover=0\n")
f.write("listenonion=0\n")
return datadir
@@ -472,7 +475,7 @@ def random_transaction(nodes, amount, min_fee, fee_increment, fee_variants):
outputs[to_node.getnewaddress()] = float(amount)
rawtx = from_node.createrawtransaction(inputs, outputs)
- signresult = from_node.signrawtransaction(rawtx)
+ signresult = from_node.signrawtransactionwithwallet(rawtx)
txid = from_node.sendrawtransaction(signresult["hex"], True)
return (txid, signresult["hex"], fee)
@@ -499,7 +502,7 @@ def create_confirmed_utxos(fee, node, count):
outputs[addr1] = satoshi_round(send_value / 2)
outputs[addr2] = satoshi_round(send_value / 2)
raw_tx = node.createrawtransaction(inputs, outputs)
- signed_tx = node.signrawtransaction(raw_tx)["hex"]
+ signed_tx = node.signrawtransactionwithwallet(raw_tx)["hex"]
node.sendrawtransaction(signed_tx)
while (node.getmempoolinfo()['size'] > 0):
@@ -533,7 +536,7 @@ def create_tx(node, coinbase, to_address, amount):
inputs = [{"txid": coinbase, "vout": 0}]
outputs = {to_address: amount}
rawtx = node.createrawtransaction(inputs, outputs)
- signresult = node.signrawtransaction(rawtx)
+ signresult = node.signrawtransactionwithwallet(rawtx)
assert_equal(signresult["complete"], True)
return signresult["hex"]
@@ -552,7 +555,7 @@ def create_lots_of_big_transactions(node, txouts, utxos, num, fee):
newtx = rawtx[0:92]
newtx = newtx + txouts
newtx = newtx + rawtx[94:]
- signresult = node.signrawtransaction(newtx, None, None, "NONE")
+ signresult = node.signrawtransactionwithwallet(newtx, None, "NONE")
txid = node.sendrawtransaction(signresult["hex"], True)
txids.append(txid)
return txids