Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/messages.py
Show All 12 Lines | |||||
msg_block, msg_tx, msg_headers, etc.: | msg_block, msg_tx, msg_headers, etc.: | ||||
data structures that represent network messages | data structures that represent network messages | ||||
ser_*, deser_*: functions that handle serialization/deserialization. | ser_*, deser_*: functions that handle serialization/deserialization. | ||||
Classes use __slots__ to ensure extraneous attributes aren't accidentally added | Classes use __slots__ to ensure extraneous attributes aren't accidentally added | ||||
by tests, compromising their intended effect. | by tests, compromising their intended effect. | ||||
""" | """ | ||||
from codecs import encode | |||||
import copy | import copy | ||||
import hashlib | import hashlib | ||||
from io import BytesIO | |||||
import random | import random | ||||
import socket | import socket | ||||
import struct | import struct | ||||
import time | import time | ||||
import unittest | import unittest | ||||
from codecs import encode | |||||
from io import BytesIO | |||||
from typing import List | from typing import List | ||||
from test_framework.siphash import siphash256 | from test_framework.siphash import siphash256 | ||||
from test_framework.util import hex_str_to_bytes, assert_equal | from test_framework.util import assert_equal, hex_str_to_bytes | ||||
MIN_VERSION_SUPPORTED = 60001 | MIN_VERSION_SUPPORTED = 60001 | ||||
# past bip-31 for ping/pong | # past bip-31 for ping/pong | ||||
MY_VERSION = 70014 | MY_VERSION = 70014 | ||||
MY_SUBVERSION = b"/python-p2p-tester:0.0.3/" | MY_SUBVERSION = b"/python-p2p-tester:0.0.3/" | ||||
# from version 70001 onwards, fRelay should be appended to version | # from version 70001 onwards, fRelay should be appended to version | ||||
# messages (BIP37) | # messages (BIP37) | ||||
MY_RELAY = 1 | MY_RELAY = 1 | ||||
▲ Show 20 Lines • Show All 2,046 Lines • Show Last 20 Lines |