diff options
| author | Suhas Daftuar <[email protected]> | 2017-04-18 12:52:08 -0400 |
|---|---|---|
| committer | Luke Dashjr <[email protected]> | 2017-04-21 12:38:23 +0000 |
| commit | 71463a7d18bb143da62e790f9194193dfaf8f320 (patch) | |
| tree | 18cf6bd6f0f518cafd69fdd3f4f7e3e9d4e8080a | |
| parent | Bugfix: PrioritiseTransaction updates the mempool tx counter (diff) | |
| download | discoin-71463a7d18bb143da62e790f9194193dfaf8f320.tar.xz discoin-71463a7d18bb143da62e790f9194193dfaf8f320.zip | |
[qa] Test prioritise_transaction / getblocktemplate interaction
Github-Pull: #10196
Rebased-From: 6a61424c9eed072ae8d79d68aac71f525c1608b5
| -rwxr-xr-x | qa/rpc-tests/prioritise_transaction.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/qa/rpc-tests/prioritise_transaction.py b/qa/rpc-tests/prioritise_transaction.py index b7459c80c..16874a6b5 100755 --- a/qa/rpc-tests/prioritise_transaction.py +++ b/qa/rpc-tests/prioritise_transaction.py @@ -16,7 +16,7 @@ class PrioritiseTransactionTest(BitcoinTestFramework): def __init__(self): super().__init__() self.setup_clean_chain = True - self.num_nodes = 1 + self.num_nodes = 2 self.txouts = gen_return_txouts() @@ -25,8 +25,11 @@ class PrioritiseTransactionTest(BitcoinTestFramework): self.is_network_split = False self.nodes.append(start_node(0, self.options.tmpdir, ["-debug", "-printpriority=1"])) + self.nodes.append(start_node(1, self.options.tmpdir, ["-debug", "-printpriority=1"])) + connect_nodes(self.nodes[0], 1) self.relayfee = self.nodes[0].getnetworkinfo()['relayfee'] + def run_test(self): utxo_count = 90 utxos = create_confirmed_utxos(self.relayfee, self.nodes[0], utxo_count) @@ -139,5 +142,16 @@ class PrioritiseTransactionTest(BitcoinTestFramework): assert_equal(self.nodes[0].sendrawtransaction(tx2_hex), tx2_id) assert(tx2_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(txid, 0, -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() |