aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/invalidblockrequest.py
diff options
context:
space:
mode:
authorCasey Rodarmor <casey@rodarmor.com>2015-08-05 17:47:34 -0400
committerCasey Rodarmor <casey@rodarmor.com>2015-08-21 15:31:37 -0400
commit0ce73985a80c3bb0c9a2024f8df6ce68c648dbb8 (patch)
treeb78eda0e18074aa748107c6296abacb034b299bf /qa/rpc-tests/invalidblockrequest.py
parent49793fbb097e9f00149a054adeddad07f0444c12 (diff)
Add p2p-fullblocktest.py
Diffstat (limited to 'qa/rpc-tests/invalidblockrequest.py')
-rwxr-xr-xqa/rpc-tests/invalidblockrequest.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/qa/rpc-tests/invalidblockrequest.py b/qa/rpc-tests/invalidblockrequest.py
index 64b8e26395..6a7980cd45 100755
--- a/qa/rpc-tests/invalidblockrequest.py
+++ b/qa/rpc-tests/invalidblockrequest.py
@@ -46,12 +46,14 @@ class InvalidBlockRequestTest(ComparisonTestFramework):
'''
Create a new block with an anyone-can-spend coinbase
'''
- block = create_block(self.tip, create_coinbase(), self.block_time)
+ height = 1
+ block = create_block(self.tip, create_coinbase(height), self.block_time)
self.block_time += 1
block.solve()
# Save the coinbase for later
self.block1 = block
self.tip = block.sha256
+ height += 1
yield TestInstance([[block, True]])
'''
@@ -59,11 +61,12 @@ class InvalidBlockRequestTest(ComparisonTestFramework):
'''
test = TestInstance(sync_every_block=False)
for i in xrange(100):
- block = create_block(self.tip, create_coinbase(), self.block_time)
+ block = create_block(self.tip, create_coinbase(height), self.block_time)
block.solve()
self.tip = block.sha256
self.block_time += 1
test.blocks_and_transactions.append([block, True])
+ height += 1
yield test
'''
@@ -73,7 +76,7 @@ class InvalidBlockRequestTest(ComparisonTestFramework):
coinbase, spend of that spend). Duplicate the 3rd transaction to
leave merkle root and blockheader unchanged but invalidate the block.
'''
- block2 = create_block(self.tip, create_coinbase(), self.block_time)
+ block2 = create_block(self.tip, create_coinbase(height), self.block_time)
self.block_time += 1
# chr(81) is OP_TRUE
@@ -95,11 +98,12 @@ class InvalidBlockRequestTest(ComparisonTestFramework):
self.tip = block2.sha256
yield TestInstance([[block2, False], [block2_orig, True]])
+ height += 1
'''
Make sure that a totally screwed up block is not valid.
'''
- block3 = create_block(self.tip, create_coinbase(), self.block_time)
+ block3 = create_block(self.tip, create_coinbase(height), self.block_time)
self.block_time += 1
block3.vtx[0].vout[0].nValue = 100*100000000 # Too high!
block3.vtx[0].sha256=None