aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-04-26 07:40:58 -0400
committerMarcoFalke <falke.marco@gmail.com>2020-04-26 07:41:01 -0400
commit3cf464de2e6d51cb35a296e95a9ab2e2eaeb7882 (patch)
tree6717728d72a947a31adaa421a7a8fd51413f6f2a /test
parent65276c7737176a5269b052ceae78dbb44b216bf4 (diff)
parentfa489011d9202d61463dbc426041c867f2670438 (diff)
downloadbitcoin-3cf464de2e6d51cb35a296e95a9ab2e2eaeb7882.tar.xz
Merge #18770: test: Remove raw-tx byte juggling in mempool_reorg
fa489011d9202d61463dbc426041c867f2670438 test: Remove raw-tx byte juggling in mempool_reorg (MarcoFalke) Pull request description: ACKs for top commit: robot-visions: ACK fa489011d9202d61463dbc426041c867f2670438 Tree-SHA512: 2ae537a5b34e48d2954ba02d9e050ae1a99043080266d5decca3f983b13bc3ddcbee1f3f3c7457e16ee76ea17b9ce08cac2e3205cf46b5e3c3e4ca5f758f00de
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/mempool_reorg.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/functional/mempool_reorg.py b/test/functional/mempool_reorg.py
index 8edfdc7a2a..8e1f87e42c 100755
--- a/test/functional/mempool_reorg.py
+++ b/test/functional/mempool_reorg.py
@@ -51,10 +51,14 @@ class MempoolCoinbaseTest(BitcoinTestFramework):
spend_103_raw = create_raw_transaction(self.nodes[0], coinbase_txids[3], node0_address, amount=49.99)
# Create a transaction which is time-locked to two blocks in the future
- timelock_tx = self.nodes[0].createrawtransaction([{"txid": coinbase_txids[0], "vout": 0}], {node0_address: 49.99})
- # Set the time lock
- timelock_tx = timelock_tx.replace("ffffffff", "11111191", 1)
- timelock_tx = timelock_tx[:-8] + hex(self.nodes[0].getblockcount() + 2)[2:] + "000000"
+ timelock_tx = self.nodes[0].createrawtransaction(
+ inputs=[{
+ "txid": coinbase_txids[0],
+ "vout": 0,
+ }],
+ outputs={node0_address: 49.99},
+ locktime=self.nodes[0].getblockcount() + 2,
+ )
timelock_tx = self.nodes[0].signrawtransactionwithwallet(timelock_tx)["hex"]
# This will raise an exception because the timelock transaction is too immature to spend
assert_raises_rpc_error(-26, "non-final", self.nodes[0].sendrawtransaction, timelock_tx)