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
@@ -173,9 +173,7 @@ class BIP68_112_113Test(BitcoinTestFramework):
|
||||
return test_blocks
|
||||
|
||||
def create_test_block(self, txs):
|
||||
block = create_block(self.tip, create_coinbase(self.tipheight + 1), self.last_block_time + 600)
|
||||
block.vtx.extend(txs)
|
||||
block.hashMerkleRoot = block.calc_merkle_root()
|
||||
block = create_block(self.tip, create_coinbase(self.tipheight + 1), self.last_block_time + 600, txlist=txs)
|
||||
block.solve()
|
||||
return block
|
||||
|
||||
|
||||
Reference in new issue
Block a user