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_block.py | |
parent | ae9df4ef937ef77405f6edd7c13615df7b63446f (diff) |
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_block.py')
-rwxr-xr-x | test/functional/feature_block.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/test/functional/feature_block.py b/test/functional/feature_block.py index 883e15dda3..a3253763bd 100755 --- a/test/functional/feature_block.py +++ b/test/functional/feature_block.py @@ -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 |