diff options
author | Casey Rodarmor <casey@rodarmor.com> | 2015-08-05 17:47:34 -0400 |
---|---|---|
committer | Casey Rodarmor <casey@rodarmor.com> | 2015-08-21 15:31:37 -0400 |
commit | 0ce73985a80c3bb0c9a2024f8df6ce68c648dbb8 (patch) | |
tree | b78eda0e18074aa748107c6296abacb034b299bf /qa/rpc-tests/bipdersig-p2p.py | |
parent | 49793fbb097e9f00149a054adeddad07f0444c12 (diff) |
Add p2p-fullblocktest.py
Diffstat (limited to 'qa/rpc-tests/bipdersig-p2p.py')
-rwxr-xr-x | qa/rpc-tests/bipdersig-p2p.py | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/qa/rpc-tests/bipdersig-p2p.py b/qa/rpc-tests/bipdersig-p2p.py index 41717377b2..ec1678cc2c 100755 --- a/qa/rpc-tests/bipdersig-p2p.py +++ b/qa/rpc-tests/bipdersig-p2p.py @@ -75,6 +75,7 @@ class BIP66Test(ComparisonTestFramework): def get_tests(self): self.coinbase_blocks = self.nodes[0].generate(2) + height = 3 # height of the next block to build self.tip = int ("0x" + self.nodes[0].getbestblockhash() + "L", 0) self.nodeaddress = self.nodes[0].getnewaddress() self.last_block_time = time.time() @@ -82,25 +83,27 @@ class BIP66Test(ComparisonTestFramework): ''' 98 more version 2 blocks ''' test_blocks = [] for i in xrange(98): - block = create_block(self.tip, create_coinbase(2), self.last_block_time + 1) + block = create_block(self.tip, create_coinbase(height), self.last_block_time + 1) block.nVersion = 2 block.rehash() block.solve() test_blocks.append([block, True]) self.last_block_time += 1 self.tip = block.sha256 + height += 1 yield TestInstance(test_blocks, sync_every_block=False) ''' Mine 749 version 3 blocks ''' test_blocks = [] for i in xrange(749): - block = create_block(self.tip, create_coinbase(2), self.last_block_time + 1) + block = create_block(self.tip, create_coinbase(height), self.last_block_time + 1) block.nVersion = 3 block.rehash() block.solve() test_blocks.append([block, True]) self.last_block_time += 1 self.tip = block.sha256 + height += 1 yield TestInstance(test_blocks, sync_every_block=False) ''' @@ -112,7 +115,7 @@ class BIP66Test(ComparisonTestFramework): unDERify(spendtx) spendtx.rehash() - block = create_block(self.tip, create_coinbase(2), self.last_block_time + 1) + block = create_block(self.tip, create_coinbase(height), self.last_block_time + 1) block.nVersion = 3 block.vtx.append(spendtx) block.hashMerkleRoot = block.calc_merkle_root() @@ -121,6 +124,7 @@ class BIP66Test(ComparisonTestFramework): self.last_block_time += 1 self.tip = block.sha256 + height += 1 yield TestInstance([[block, True]]) ''' @@ -132,7 +136,7 @@ class BIP66Test(ComparisonTestFramework): unDERify(spendtx) spendtx.rehash() - block = create_block(self.tip, create_coinbase(1), self.last_block_time + 1) + block = create_block(self.tip, create_coinbase(height), self.last_block_time + 1) block.nVersion = 3 block.vtx.append(spendtx) block.hashMerkleRoot = block.calc_merkle_root() @@ -144,35 +148,38 @@ class BIP66Test(ComparisonTestFramework): ''' Mine 199 new version blocks on last valid tip ''' test_blocks = [] for i in xrange(199): - block = create_block(self.tip, create_coinbase(1), self.last_block_time + 1) + block = create_block(self.tip, create_coinbase(height), self.last_block_time + 1) block.nVersion = 3 block.rehash() block.solve() test_blocks.append([block, True]) self.last_block_time += 1 self.tip = block.sha256 + height += 1 yield TestInstance(test_blocks, sync_every_block=False) ''' Mine 1 old version block ''' - block = create_block(self.tip, create_coinbase(1), self.last_block_time + 1) + block = create_block(self.tip, create_coinbase(height), self.last_block_time + 1) block.nVersion = 2 block.rehash() block.solve() self.last_block_time += 1 self.tip = block.sha256 + height += 1 yield TestInstance([[block, True]]) ''' Mine 1 new version block ''' - block = create_block(self.tip, create_coinbase(1), self.last_block_time + 1) + block = create_block(self.tip, create_coinbase(height), self.last_block_time + 1) block.nVersion = 3 block.rehash() block.solve() self.last_block_time += 1 self.tip = block.sha256 + height += 1 yield TestInstance([[block, True]]) ''' Mine 1 old version block, should be invalid ''' - block = create_block(self.tip, create_coinbase(1), self.last_block_time + 1) + block = create_block(self.tip, create_coinbase(height), self.last_block_time + 1) block.nVersion = 2 block.rehash() block.solve() |