aboutsummaryrefslogtreecommitdiff
path: root/test/functional/p2p_eviction.py
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2021-06-15 23:02:28 +0200
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2021-06-21 14:28:05 +0200
commit2ce7b47958c4a10ba20dc86c011d71cda4b070a5 (patch)
tree9d3ad9433f7b5b054f5b072ebf33462399d9f502 /test/functional/p2p_eviction.py
parent965e93743454112c0c3c66bf24852f63ee07b862 (diff)
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)`.
Diffstat (limited to 'test/functional/p2p_eviction.py')
-rwxr-xr-xtest/functional/p2p_eviction.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/functional/p2p_eviction.py b/test/functional/p2p_eviction.py
index a525996493..35bce7c69e 100755
--- a/test/functional/p2p_eviction.py
+++ b/test/functional/p2p_eviction.py
@@ -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")