mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-09 09:51:08 +02:00
test: refactor: take use of create_block
txlist parameter
Passing a list of transactions `txlist` to `create_block` appends them to the block, hence we don't need to do that manually anymore. The merkle root calculation can also be removed, since this is done in the end of the helper.
This commit is contained in:
@ -120,9 +120,7 @@ class BIP65Test(BitcoinTestFramework):
|
||||
|
||||
tip = self.nodes[0].getbestblockhash()
|
||||
block_time = self.nodes[0].getblockheader(tip)['mediantime'] + 1
|
||||
block = create_block(int(tip, 16), create_coinbase(CLTV_HEIGHT - 1), block_time, version=3)
|
||||
block.vtx.extend(invalid_cltv_txs)
|
||||
block.hashMerkleRoot = block.calc_merkle_root()
|
||||
block = create_block(int(tip, 16), create_coinbase(CLTV_HEIGHT - 1), block_time, version=3, txlist=invalid_cltv_txs)
|
||||
block.solve()
|
||||
|
||||
self.test_cltv_info(is_active=False) # Not active as of current tip and next block does not need to obey rules
|
||||
|
Reference in New Issue
Block a user