aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/test_framework/util.py
diff options
context:
space:
mode:
authorSuhas Daftuar <sdaftuar@chaincode.com>2016-03-01 09:28:16 -0500
committerSuhas Daftuar <sdaftuar@gmail.com>2016-03-16 12:52:04 -0400
commitec143391ef791c15c0d4520befb8863b61bfc2ea (patch)
treee2cdfa6015e7e75dab2f2355fc591fe91df386c5 /qa/rpc-tests/test_framework/util.py
parent3d0dfdbf9f26dcda6bc8a397752bdcc59ee474f4 (diff)
Tests: make prioritise_transaction.py more robust
Diffstat (limited to 'qa/rpc-tests/test_framework/util.py')
-rw-r--r--qa/rpc-tests/test_framework/util.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/qa/rpc-tests/test_framework/util.py b/qa/rpc-tests/test_framework/util.py
index ce3102988a..8d4bd52b94 100644
--- a/qa/rpc-tests/test_framework/util.py
+++ b/qa/rpc-tests/test_framework/util.py
@@ -448,6 +448,8 @@ def assert_is_hash_string(string, length=64):
def satoshi_round(amount):
return Decimal(amount).quantize(Decimal('0.00000001'), rounding=ROUND_DOWN)
+# Helper to create at least "count" utxos
+# Pass in a fee that is sufficient for relay and mining new transactions.
def create_confirmed_utxos(fee, node, count):
node.generate(int(0.5*count)+101)
utxos = node.listunspent()
@@ -475,6 +477,8 @@ def create_confirmed_utxos(fee, node, count):
assert(len(utxos) >= count)
return utxos
+# Create large OP_RETURN txouts that can be appended to a transaction
+# to make it large (helper for constructing large transactions).
def gen_return_txouts():
# Some pre-processing to create a bunch of OP_RETURN txouts to insert into transactions we create
# So we have big transactions (and therefore can't fit very many into each block)
@@ -501,6 +505,8 @@ def create_tx(node, coinbase, to_address, amount):
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, fee):
addr = node.getnewaddress()
txids = []