aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/test_framework')
-rw-r--r--test/functional/test_framework/blocktools.py13
-rw-r--r--test/functional/test_framework/util.py8
2 files changed, 13 insertions, 8 deletions
diff --git a/test/functional/test_framework/blocktools.py b/test/functional/test_framework/blocktools.py
index 898da9346a..c2d20d27b5 100644
--- a/test/functional/test_framework/blocktools.py
+++ b/test/functional/test_framework/blocktools.py
@@ -128,6 +128,19 @@ def create_transaction(prevtx, n, sig, value, script_pub_key=CScript()):
tx.calc_sha256()
return tx
+def create_raw_transaction(node, txid, to_address, amount):
+ """ Return raw signed transaction spending the first output of the
+ input txid. Note that the node must be able to sign for the
+ output that is being spent, and the node must not be running
+ multiple wallets.
+ """
+ inputs = [{"txid": txid, "vout": 0}]
+ outputs = {to_address: amount}
+ rawtx = node.createrawtransaction(inputs, outputs)
+ signresult = node.signrawtransactionwithwallet(rawtx)
+ assert_equal(signresult["complete"], True)
+ return signresult['hex']
+
def get_legacy_sigopcount_block(block, accurate=True):
count = 0
for tx in block.vtx:
diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py
index be40fa60e5..b355816d8b 100644
--- a/test/functional/test_framework/util.py
+++ b/test/functional/test_framework/util.py
@@ -526,14 +526,6 @@ def gen_return_txouts():
txouts = txouts + script_pubkey
return txouts
-def create_tx(node, coinbase, to_address, amount):
- inputs = [{"txid": coinbase, "vout": 0}]
- outputs = {to_address: amount}
- rawtx = node.createrawtransaction(inputs, outputs)
- signresult = node.signrawtransactionwithwallet(rawtx)
- assert_equal(signresult["complete"], True)
- return signresult["hex"]
-
# Create a spend of each passed-in utxo, splicing in "txouts" to each raw
# transaction to make it large. See gen_return_txouts() above.
def create_lots_of_big_transactions(node, txouts, utxos, num, fee):