aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/prioritise_transaction.py
diff options
context:
space:
mode:
Diffstat (limited to 'qa/rpc-tests/prioritise_transaction.py')
-rwxr-xr-xqa/rpc-tests/prioritise_transaction.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/qa/rpc-tests/prioritise_transaction.py b/qa/rpc-tests/prioritise_transaction.py
index f8d9063b4e..e1771231c0 100755
--- a/qa/rpc-tests/prioritise_transaction.py
+++ b/qa/rpc-tests/prioritise_transaction.py
@@ -1,5 +1,5 @@
-#!/usr/bin/env python2
-# Copyright (c) 2015 The Bitcoin Core developers
+#!/usr/bin/env python3
+# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -14,11 +14,11 @@ from test_framework.mininode import COIN, MAX_BLOCK_SIZE
class PrioritiseTransactionTest(BitcoinTestFramework):
def __init__(self):
- self.txouts = gen_return_txouts()
+ super().__init__()
+ self.setup_clean_chain = True
+ self.num_nodes = 1
- def setup_chain(self):
- print("Initializing test directory "+self.options.tmpdir)
- initialize_chain_clean(self.options.tmpdir, 1)
+ self.txouts = gen_return_txouts()
def setup_network(self):
self.nodes = []
@@ -35,7 +35,7 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
# Create 3 batches of transactions at 3 different fee rate levels
range_size = utxo_count // 3
- for i in xrange(3):
+ for i in range(3):
txids.append([])
start_range = i * range_size
end_range = start_range + range_size
@@ -46,7 +46,7 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
# more transactions.
mempool = self.nodes[0].getrawmempool(True)
sizes = [0, 0, 0]
- for i in xrange(3):
+ for i in range(3):
for j in txids[i]:
assert(j in mempool)
sizes[i] += mempool[j]['size']
@@ -61,7 +61,7 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
self.nodes[0].generate(1)
mempool = self.nodes[0].getrawmempool()
- print "Assert that prioritised transaction was mined"
+ print("Assert that prioritised transaction was mined")
assert(txids[0][0] not in mempool)
assert(txids[0][1] in mempool)
@@ -93,7 +93,7 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
# High fee transaction should not have been mined, but other high fee rate
# transactions should have been.
mempool = self.nodes[0].getrawmempool()
- print "Assert that de-prioritised transaction is still in mempool"
+ print("Assert that de-prioritised transaction is still in mempool")
assert(high_fee_tx in mempool)
for x in txids[2]:
if (x != high_fee_tx):
@@ -135,7 +135,7 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
# accepted.
self.nodes[0].prioritisetransaction(tx2_id, 0, int(self.relayfee*COIN))
- print "Assert that prioritised free transaction is accepted to mempool"
+ print("Assert that prioritised free transaction is accepted to mempool")
assert_equal(self.nodes[0].sendrawtransaction(tx2_hex), tx2_id)
assert(tx2_id in self.nodes[0].getrawmempool())