Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/avatools.py
Show All 20 Lines | from .messages import ( | ||||
FromHex, | FromHex, | ||||
LegacyAvalancheProof, | LegacyAvalancheProof, | ||||
TCPAvalancheResponse, | TCPAvalancheResponse, | ||||
ToHex, | ToHex, | ||||
hash256, | hash256, | ||||
msg_avahello, | msg_avahello, | ||||
msg_avapoll, | msg_avapoll, | ||||
msg_avaproof, | msg_avaproof, | ||||
msg_getavaproofs, | |||||
msg_tcpavaresponse, | msg_tcpavaresponse, | ||||
) | ) | ||||
from .p2p import P2PInterface, p2p_lock | from .p2p import P2PInterface, p2p_lock | ||||
from .test_node import TestNode | from .test_node import TestNode | ||||
from .util import assert_equal, satoshi_round, wait_until_helper | from .util import assert_equal, satoshi_round, wait_until_helper | ||||
from .wallet_util import bytes_to_wif | from .wallet_util import bytes_to_wif | ||||
▲ Show 20 Lines • Show All 230 Lines • ▼ Show 20 Lines | def send_avahello(self, delegation_hex: str, delegated_privkey: ECKey): | ||||
return delegation.proofid | return delegation.proofid | ||||
def send_avaproof(self, proof: AvalancheProof): | def send_avaproof(self, proof: AvalancheProof): | ||||
msg = msg_avaproof() | msg = msg_avaproof() | ||||
msg.proof = proof | msg.proof = proof | ||||
self.send_message(msg) | self.send_message(msg) | ||||
def send_getavaproofs(self): | |||||
self.send_message(msg_getavaproofs()) | |||||
def get_ava_p2p_interface( | def get_ava_p2p_interface( | ||||
node: TestNode, | node: TestNode, | ||||
services=NODE_NETWORK | NODE_AVALANCHE) -> AvaP2PInterface: | services=NODE_NETWORK | NODE_AVALANCHE) -> AvaP2PInterface: | ||||
"""Build and return an AvaP2PInterface connected to the specified | """Build and return an AvaP2PInterface connected to the specified | ||||
TestNode. | TestNode. | ||||
""" | """ | ||||
n = AvaP2PInterface() | n = AvaP2PInterface() | ||||
Show All 20 Lines |