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/interface_zmq.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/interface_zmq.py')
-rwxr-xr-x | test/functional/interface_zmq.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/test/functional/interface_zmq.py b/test/functional/interface_zmq.py index 395fde18fd..1ee12c0040 100755 --- a/test/functional/interface_zmq.py +++ b/test/functional/interface_zmq.py @@ -18,7 +18,6 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.messages import ( CTransaction, hash256, - tx_from_hex, ) from test_framework.util import ( assert_equal, @@ -402,12 +401,8 @@ class ZMQTest (BitcoinTestFramework): raw_tx = self.nodes[0].getrawtransaction(orig_txid) bump_info = self.nodes[0].bumpfee(orig_txid) # Mine the pre-bump tx - block = create_block(int(self.nodes[0].getbestblockhash(), 16), create_coinbase(self.nodes[0].getblockcount()+1)) - tx = tx_from_hex(raw_tx) - block.vtx.append(tx) - for txid in more_tx: - tx = tx_from_hex(self.nodes[0].getrawtransaction(txid)) - block.vtx.append(tx) + txs_to_add = [raw_tx] + [self.nodes[0].getrawtransaction(txid) for txid in more_tx] + block = create_block(int(self.nodes[0].getbestblockhash(), 16), create_coinbase(self.nodes[0].getblockcount()+1), txlist=txs_to_add) add_witness_commitment(block) block.solve() assert_equal(self.nodes[0].submitblock(block.serialize().hex()), None) |