Changeset View
Changeset View
Standalone View
Standalone View
test/functional/feature_dersig.py
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
self.log.info("Mining {} blocks".format(DERSIG_HEIGHT - 1)) | self.log.info("Mining {} blocks".format(DERSIG_HEIGHT - 1)) | ||||
self.coinbase_txids = [self.nodes[0].getblock( | self.coinbase_txids = [self.nodes[0].getblock( | ||||
b)['tx'][0] for b in self.nodes[0].generate(DERSIG_HEIGHT - 1)] | b)['tx'][0] for b in self.nodes[0].generate(DERSIG_HEIGHT - 1)] | ||||
self.nodeaddress = self.nodes[0].getnewaddress() | self.nodeaddress = self.nodes[0].getnewaddress() | ||||
self.log.info("Test that blocks must now be at least version 3") | self.log.info("Test that blocks must now be at least version 3") | ||||
tip = self.nodes[0].getbestblockhash() | tip = self.nodes[0].getbestblockhash() | ||||
block_time = self.nodes[0].getblockheader(tip)['mediantime'] + 1 | block_time = self.nodes[0].getblockheader(tip)['time'] + 1 | ||||
block = create_block( | block = create_block( | ||||
int(tip, 16), create_coinbase(DERSIG_HEIGHT), block_time) | int(tip, 16), create_coinbase(DERSIG_HEIGHT), block_time) | ||||
block.nVersion = 2 | block.nVersion = 2 | ||||
block.rehash() | block.rehash() | ||||
block.solve() | block.solve() | ||||
with self.nodes[0].assert_debug_log(expected_msgs=['{}, bad-version(0x00000002)'.format(block.hash)]): | with self.nodes[0].assert_debug_log(expected_msgs=['{}, bad-version(0x00000002)'.format(block.hash)]): | ||||
self.nodes[0].p2p.send_and_ping(msg_block(block)) | self.nodes[0].p2p.send_and_ping(msg_block(block)) | ||||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |