mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-12 17:12:37 +02:00
test: remove ToHex
helper, use .serialize().hex() instead
This commit is contained in:
@ -23,7 +23,6 @@ from .messages import (
|
||||
CTxIn,
|
||||
CTxInWitness,
|
||||
CTxOut,
|
||||
ToHex,
|
||||
hash256,
|
||||
hex_str_to_bytes,
|
||||
ser_uint256,
|
||||
@ -250,7 +249,7 @@ def send_to_witness(use_p2wsh, node, utxo, pubkey, encode_p2sh, amount, sign=Tru
|
||||
if (insert_redeem_script):
|
||||
tx = tx_from_hex(tx_to_witness)
|
||||
tx.vin[0].scriptSig += CScript([hex_str_to_bytes(insert_redeem_script)])
|
||||
tx_to_witness = ToHex(tx)
|
||||
tx_to_witness = tx.serialize().hex()
|
||||
|
||||
return node.sendrawtransaction(tx_to_witness)
|
||||
|
||||
|
@ -196,11 +196,6 @@ def FromHex(obj, hex_string):
|
||||
return obj
|
||||
|
||||
|
||||
# Convert a binary-serializable object to hex (eg for submission via RPC)
|
||||
def ToHex(obj):
|
||||
return obj.serialize().hex()
|
||||
|
||||
|
||||
def tx_from_hex(hex_string):
|
||||
"""Deserialize from hex string to a transaction object"""
|
||||
return FromHex(CTransaction(), hex_string)
|
||||
|
Reference in New Issue
Block a user