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:
1 parent
ae9df4ef93
commit
df5d783aef
11 files changed
+19
-56
No files matched your search
@@ -1361,11 +1361,10 @@ class FullBlockTest(BitcoinTestFramework):
|
||||
else:
|
||||
coinbase.vout[0].nValue += spend.vout[0].nValue - 1 # all but one satoshi to fees
|
||||
coinbase.rehash()
|
||||
block = create_block(base_block_hash, coinbase, block_time, version=version)
|
||||
tx = self.create_tx(spend, 0, 1, script) # spend 1 satoshi
|
||||
self.sign_tx(tx, spend)
|
||||
self.add_transactions_to_block(block, [tx])
|
||||
block.hashMerkleRoot = block.calc_merkle_root()
|
||||
tx.rehash()
|
||||
block = create_block(base_block_hash, coinbase, block_time, version=version, txlist=[tx])
|
||||
# Block is created. Find a valid nonce.
|
||||
block.solve()
|
||||
self.tip = block
|
||||
|
||||
Reference in new issue
Block a user