diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2021-11-15 18:29:13 +0100 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2021-11-17 15:45:30 +0100 |
commit | df5d783aef3e5af2d1294fc8ff9470a5dc878325 (patch) | |
tree | 0004a7e5e021e9bc4d989b9c2e4cdc552404fb48 /test/functional/feature_taproot.py | |
parent | ae9df4ef937ef77405f6edd7c13615df7b63446f (diff) | |
download | bitcoin-df5d783aef3e5af2d1294fc8ff9470a5dc878325.tar.xz |
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.
Diffstat (limited to 'test/functional/feature_taproot.py')
-rwxr-xr-x | test/functional/feature_taproot.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/test/functional/feature_taproot.py b/test/functional/feature_taproot.py index ed0fe25601..de679fbf44 100755 --- a/test/functional/feature_taproot.py +++ b/test/functional/feature_taproot.py @@ -1266,11 +1266,8 @@ class TaprootTest(BitcoinTestFramework): # transactions. extra_output_script = CScript([OP_CHECKSIG]*((MAX_BLOCK_SIGOPS_WEIGHT - sigops_weight) // WITNESS_SCALE_FACTOR)) - block = create_block(self.tip, create_coinbase(self.lastblockheight + 1, pubkey=cb_pubkey, extra_output_script=extra_output_script, fees=fees), self.lastblocktime + 1) - for tx in txs: - tx.rehash() - block.vtx.append(tx) - block.hashMerkleRoot = block.calc_merkle_root() + coinbase_tx = create_coinbase(self.lastblockheight + 1, pubkey=cb_pubkey, extra_output_script=extra_output_script, fees=fees) + block = create_block(self.tip, coinbase_tx, self.lastblocktime + 1, txlist=txs) witness and add_witness_commitment(block) block.solve() block_response = node.submitblock(block.serialize().hex()) |