mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-29 18:20:58 +02:00
test: introduce tx_from_hex
helper for tx deserialization
`FromHex` is mostly used for transactions, so we introduce a shortcut `tx_from_hex` for `FromHex(CTransaction, hex_str)`.
This commit is contained in:
@ -8,13 +8,12 @@ Test transaction download behavior
|
||||
|
||||
from test_framework.messages import (
|
||||
CInv,
|
||||
CTransaction,
|
||||
FromHex,
|
||||
MSG_TX,
|
||||
MSG_TYPE_MASK,
|
||||
MSG_WTX,
|
||||
msg_inv,
|
||||
msg_notfound,
|
||||
tx_from_hex,
|
||||
)
|
||||
from test_framework.p2p import (
|
||||
P2PInterface,
|
||||
@ -100,7 +99,7 @@ class TxDownloadTest(BitcoinTestFramework):
|
||||
hexstring=tx,
|
||||
privkeys=[self.nodes[0].get_deterministic_priv_key().key],
|
||||
)['hex']
|
||||
ctx = FromHex(CTransaction(), tx)
|
||||
ctx = tx_from_hex(tx)
|
||||
txid = int(ctx.rehash(), 16)
|
||||
|
||||
self.log.info(
|
||||
|
Reference in New Issue
Block a user