test: Remove raw-tx byte juggling in mempool_reorg

pull/764/head
MarcoFalke 5 years ago
parent 3e7c118d65
commit fa489011d9
No known key found for this signature in database
GPG Key ID: CE2B75697E69A548

@ -51,10 +51,14 @@ class MempoolCoinbaseTest(BitcoinTestFramework):
spend_103_raw = create_raw_transaction(self.nodes[0], coinbase_txids[3], node0_address, amount=49.99) 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 # 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}) timelock_tx = self.nodes[0].createrawtransaction(
# Set the time lock inputs=[{
timelock_tx = timelock_tx.replace("ffffffff", "11111191", 1) "txid": coinbase_txids[0],
timelock_tx = timelock_tx[:-8] + hex(self.nodes[0].getblockcount() + 2)[2:] + "000000" "vout": 0,
}],
outputs={node0_address: 49.99},
locktime=self.nodes[0].getblockcount() + 2,
)
timelock_tx = self.nodes[0].signrawtransactionwithwallet(timelock_tx)["hex"] timelock_tx = self.nodes[0].signrawtransactionwithwallet(timelock_tx)["hex"]
# This will raise an exception because the timelock transaction is too immature to spend # 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) assert_raises_rpc_error(-26, "non-final", self.nodes[0].sendrawtransaction, timelock_tx)

Loading…
Cancel
Save