mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-29 23:37:44 +01:00
test: remove ToHex helper, use .serialize().hex() instead
This commit is contained in:
@@ -23,7 +23,6 @@ from test_framework.messages import (
|
||||
CTransaction,
|
||||
CTxIn,
|
||||
CTxOut,
|
||||
ToHex,
|
||||
sha256,
|
||||
tx_from_hex,
|
||||
)
|
||||
@@ -268,7 +267,7 @@ class SegWitTest(BitcoinTestFramework):
|
||||
tx = CTransaction()
|
||||
tx.vin.append(CTxIn(COutPoint(int(txid1, 16), 0), b''))
|
||||
tx.vout.append(CTxOut(int(49.99 * COIN), CScript([OP_TRUE, OP_DROP] * 15 + [OP_TRUE])))
|
||||
tx2_hex = self.nodes[0].signrawtransactionwithwallet(ToHex(tx))['hex']
|
||||
tx2_hex = self.nodes[0].signrawtransactionwithwallet(tx.serialize().hex())['hex']
|
||||
txid2 = self.nodes[0].sendrawtransaction(tx2_hex)
|
||||
tx = tx_from_hex(tx2_hex)
|
||||
assert not tx.wit.is_null()
|
||||
@@ -285,7 +284,7 @@ class SegWitTest(BitcoinTestFramework):
|
||||
tx.vin.append(CTxIn(COutPoint(int(txid2, 16), 0), b""))
|
||||
tx.vout.append(CTxOut(int(49.95 * COIN), CScript([OP_TRUE, OP_DROP] * 15 + [OP_TRUE]))) # Huge fee
|
||||
tx.calc_sha256()
|
||||
txid3 = self.nodes[0].sendrawtransaction(hexstring=ToHex(tx), maxfeerate=0)
|
||||
txid3 = self.nodes[0].sendrawtransaction(hexstring=tx.serialize().hex(), maxfeerate=0)
|
||||
assert tx.wit.is_null()
|
||||
assert txid3 in self.nodes[0].getrawmempool()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user