aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/mempool_spendcoinbase.py
diff options
context:
space:
mode:
authorRoss Nicoll <[email protected]>2018-02-11 21:00:50 +0000
committerRoss Nicoll <[email protected]>2018-09-19 22:11:47 +0100
commit9c3a11b2488f3e01e6763bc1217598a4d1c69bde (patch)
treeed6b54c5b71a4543a32968dc5b1d391bfe59dfed /qa/rpc-tests/mempool_spendcoinbase.py
parentInsert Dogecoin testnet merkle tree root value (#1469) (diff)
downloaddiscoin-9c3a11b2488f3e01e6763bc1217598a4d1c69bde.tar.xz
discoin-9c3a11b2488f3e01e6763bc1217598a4d1c69bde.zip
Clean up RPC tests (#1465)
* Enable full block tests * Fix invalidblocktest * Move watch only address funding to immediately before it's used, so node 0 doesn't spend the output before it checks it later. * Fix `fundrawtransaction` tests and sanitize fee calculation at the same time * Correct resolution of chain parameters when validating tx inputs, especially from previous coinbase transactions * Set block versions on full block tests so that the generated blocks are AuxPoW compatible
Diffstat (limited to 'qa/rpc-tests/mempool_spendcoinbase.py')
-rwxr-xr-xqa/rpc-tests/mempool_spendcoinbase.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/qa/rpc-tests/mempool_spendcoinbase.py b/qa/rpc-tests/mempool_spendcoinbase.py
index e74a4541e..3fdba761d 100755
--- a/qa/rpc-tests/mempool_spendcoinbase.py
+++ b/qa/rpc-tests/mempool_spendcoinbase.py
@@ -6,8 +6,8 @@
#
# Test spending coinbase transactions.
# The coinbase transaction in block N can appear in block
-# N+100... so is valid in the mempool when the best block
-# height is N+99.
+# N+60... so is valid in the mempool when the best block
+# height is N+59.
# This test makes sure coinbase spends that will be mature
# in the next block are accepted into the memory pool,
# but less mature coinbase spends are NOT.
@@ -43,21 +43,21 @@ class MempoolSpendCoinbaseTest(BitcoinTestFramework):
coinbase_txids = [ self.nodes[0].getblock(h)['tx'][0] for h in b ]
spends_raw = [ create_tx(self.nodes[0], txid, node0_address, 500000) for txid in coinbase_txids ]
- spend_101_id = self.nodes[0].sendrawtransaction(spends_raw[0])
+ spend_61_id = self.nodes[0].sendrawtransaction(spends_raw[0])
- # coinbase at height 102 should be too immature to spend
+ # coinbase at height 62 should be too immature to spend
assert_raises(JSONRPCException, self.nodes[0].sendrawtransaction, spends_raw[1])
- # mempool should have just spend_101:
- assert_equal(self.nodes[0].getrawmempool(), [ spend_101_id ])
+ # mempool should have just spend_61:
+ assert_equal(self.nodes[0].getrawmempool(), [ spend_61_id ])
- # mine a block, spend_101 should get confirmed
+ # mine a block, spend_61 should get confirmed
self.nodes[0].generate(1)
assert_equal(set(self.nodes[0].getrawmempool()), set())
- # ... and now height 102 can be spent:
- spend_102_id = self.nodes[0].sendrawtransaction(spends_raw[1])
- assert_equal(self.nodes[0].getrawmempool(), [ spend_102_id ])
+ # ... and now height 62 can be spent:
+ spend_62_id = self.nodes[0].sendrawtransaction(spends_raw[1])
+ assert_equal(self.nodes[0].getrawmempool(), [ spend_62_id ])
if __name__ == '__main__':
MempoolSpendCoinbaseTest().main()