aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2021-11-13 00:11:25 +0100
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2021-11-13 00:21:57 +0100
commitf1ed30451f04af4b45b6368305722f715dcbf4fb (patch)
tree4e8cba175243f61151d09498c7dbfe9d26d788ff /test/functional
parent5ba9f1ff598e30a70407f331fabcbe9b4e17315a (diff)
test: refactor: simplify `block_submit` in feature_nulldummy.py
The `create_block` helper accepts a list of txs that it includes in the created block, hence we don't have to do that manually. Also, rehashing before solving the block is not needed and can be removed.
Diffstat (limited to 'test/functional')
-rwxr-xr-xtest/functional/feature_nulldummy.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/test/functional/feature_nulldummy.py b/test/functional/feature_nulldummy.py
index 2055e04a96..9fc19395db 100755
--- a/test/functional/feature_nulldummy.py
+++ b/test/functional/feature_nulldummy.py
@@ -121,14 +121,9 @@ class NULLDUMMYTest(BitcoinTestFramework):
tmpl = node.getblocktemplate(NORMAL_GBT_REQUEST_PARAMS)
assert_equal(tmpl['previousblockhash'], self.lastblockhash)
assert_equal(tmpl['height'], self.lastblockheight + 1)
- block = create_block(tmpl=tmpl, ntime=self.lastblocktime + 1)
- for tx in txs:
- tx.rehash()
- block.vtx.append(tx)
- block.hashMerkleRoot = block.calc_merkle_root()
+ block = create_block(tmpl=tmpl, ntime=self.lastblocktime + 1, txlist=txs)
if with_witness:
add_witness_commitment(block)
- block.rehash()
block.solve()
assert_equal(None if accept else NULLDUMMY_ERROR, node.submitblock(block.serialize().hex()))
if accept: