mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-29 02:11:24 +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:
@ -20,7 +20,11 @@ from test_framework.blocktools import (
|
||||
create_block,
|
||||
create_coinbase,
|
||||
)
|
||||
from test_framework.messages import CTransaction, FromHex, msg_pong, msg_tx
|
||||
from test_framework.messages import (
|
||||
msg_pong,
|
||||
msg_tx,
|
||||
tx_from_hex,
|
||||
)
|
||||
from test_framework.p2p import P2PDataStore, P2PInterface
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import assert_equal
|
||||
@ -89,7 +93,7 @@ class P2PEvict(BitcoinTestFramework):
|
||||
'scriptPubKey': prevtx['vout'][0]['scriptPubKey']['hex'],
|
||||
}],
|
||||
)['hex']
|
||||
txpeer.send_message(msg_tx(FromHex(CTransaction(), sigtx)))
|
||||
txpeer.send_message(msg_tx(tx_from_hex(sigtx)))
|
||||
protected_peers.add(current_peer)
|
||||
|
||||
self.log.info("Create 8 peers and protect them from eviction by having faster pings")
|
||||
|
Reference in New Issue
Block a user