aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/blocktools.py
diff options
context:
space:
mode:
authorConor Scott <conor.r.scott.88@gmail.com>2018-07-30 10:03:20 +0200
committerConor Scott <conor.r.scott.88@gmail.com>2018-08-09 12:58:35 +0200
commit157651855f91c3c093c27290a349a231ac5ba740 (patch)
treea61b17615865bcfee8a9f42547d98f9494f42674 /test/functional/test_framework/blocktools.py
parentdf9f71274645a917e2578c52a1c59745bce8112d (diff)
[Tests] Rename create_tx and move to blocktools.py
Diffstat (limited to 'test/functional/test_framework/blocktools.py')
-rw-r--r--test/functional/test_framework/blocktools.py13
1 files changed, 13 insertions, 0 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: