Skip to content

Commit fa48901

Browse files
author
MarcoFalke
committed
test: Remove raw-tx byte juggling in mempool_reorg
1 parent 3e7c118 commit fa48901

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/functional/mempool_reorg.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,14 @@ def run_test(self):
5151
spend_103_raw = create_raw_transaction(self.nodes[0], coinbase_txids[3], node0_address, amount=49.99)
5252

5353
# Create a transaction which is time-locked to two blocks in the future
54-
timelock_tx = self.nodes[0].createrawtransaction([{"txid": coinbase_txids[0], "vout": 0}], {node0_address: 49.99})
55-
# Set the time lock
56-
timelock_tx = timelock_tx.replace("ffffffff", "11111191", 1)
57-
timelock_tx = timelock_tx[:-8] + hex(self.nodes[0].getblockcount() + 2)[2:] + "000000"
54+
timelock_tx = self.nodes[0].createrawtransaction(
55+
inputs=[{
56+
"txid": coinbase_txids[0],
57+
"vout": 0,
58+
}],
59+
outputs={node0_address: 49.99},
60+
locktime=self.nodes[0].getblockcount() + 2,
61+
)
5862
timelock_tx = self.nodes[0].signrawtransactionwithwallet(timelock_tx)["hex"]
5963
# This will raise an exception because the timelock transaction is too immature to spend
6064
assert_raises_rpc_error(-26, "non-final", self.nodes[0].sendrawtransaction, timelock_tx)

0 commit comments

Comments
 (0)