mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-02 03:31:35 +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:
@ -225,10 +225,9 @@ class AcceptBlockTest(BitcoinTestFramework):
|
||||
block_289f.solve()
|
||||
block_290f = create_block(block_289f.sha256, create_coinbase(290), block_289f.nTime+1)
|
||||
block_290f.solve()
|
||||
block_291 = create_block(block_290f.sha256, create_coinbase(291), block_290f.nTime+1)
|
||||
# block_291 spends a coinbase below maturity!
|
||||
block_291.vtx.append(create_tx_with_script(block_290f.vtx[0], 0, script_sig=b"42", amount=1))
|
||||
block_291.hashMerkleRoot = block_291.calc_merkle_root()
|
||||
tx_to_add = create_tx_with_script(block_290f.vtx[0], 0, script_sig=b"42", amount=1)
|
||||
block_291 = create_block(block_290f.sha256, create_coinbase(291), block_290f.nTime+1, txlist=[tx_to_add])
|
||||
block_291.solve()
|
||||
block_292 = create_block(block_291.sha256, create_coinbase(292), block_291.nTime+1)
|
||||
block_292.solve()
|
||||
|
Reference in New Issue
Block a user