aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSuhas Daftuar <sdaftuar@gmail.com>2017-04-18 12:52:08 -0400
committerSuhas Daftuar <sdaftuar@chaincode.com>2017-05-06 05:32:28 -0400
commit6c2e25caf6b6e55bbb4161f815f1c6402ac10d10 (patch)
treea16aca592e5327bb5d17bc4fef8075faf3129a67 /test
parentacc2e4bc96ed705aed3b331141028f7b838eccbe (diff)
[qa] Test prioritise_transaction / getblocktemplate interaction
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/prioritise_transaction.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/test/functional/prioritise_transaction.py b/test/functional/prioritise_transaction.py
index a07923edba..9c3b3fd5d9 100755
--- a/test/functional/prioritise_transaction.py
+++ b/test/functional/prioritise_transaction.py
@@ -13,8 +13,8 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = True
- self.num_nodes = 1
- self.extra_args = [["-printpriority=1"]]
+ self.num_nodes = 2
+ self.extra_args = [["-printpriority=1"], ["-printpriority=1"]]
def run_test(self):
self.txouts = gen_return_txouts()
@@ -115,5 +115,16 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
assert_equal(self.nodes[0].sendrawtransaction(tx_hex), tx_id)
assert(tx_id in self.nodes[0].getrawmempool())
+ # Test that calling prioritisetransaction is sufficient to trigger
+ # getblocktemplate to (eventually) return a new block.
+ mock_time = int(time.time())
+ self.nodes[0].setmocktime(mock_time)
+ template = self.nodes[0].getblocktemplate()
+ self.nodes[0].prioritisetransaction(tx_id, -int(self.relayfee*COIN))
+ self.nodes[0].setmocktime(mock_time+10)
+ new_template = self.nodes[0].getblocktemplate()
+
+ assert(template != new_template)
+
if __name__ == '__main__':
PrioritiseTransactionTest().main()