[test] Move MY_SUBVERSION to p2p.py

The messages.py module should contain code and helpers for
[de]serializing p2p messages. Specific usage of those messages should
be in p2p.py. Therefore move MY_SUBVERSION to p2p.py.

Also rename to P2P_SUBVERSION.
This commit is contained in:
John Newbery committed 2021-02-17 09:22:37 +00:00
1 parent 7e158a6910
commit 9b4054cb7a
5 files changed
+13 -5

No files matched your search

+3
View File
@@ -83,6 +83,8 @@ MIN_P2P_VERSION_SUPPORTED = 60001
# The P2P version that this test framework implements and sends in its `version` message
# Version 70016 supports wtxid relay
P2P_VERSION = 70016
# The P2P user agent string that this test framework sends in its `version` message
P2P_SUBVERSION = "/python-p2p-tester:0.0.3/"
MESSAGEMAP = {
b"addr": msg_addr,
@@ -333,6 +335,7 @@ class P2PInterface(P2PConnection):
# Send a version msg
vt = msg_version()
vt.nVersion = P2P_VERSION
vt.strSubVer = P2P_SUBVERSION
vt.nServices = services
vt.addrTo.ip = self.dstaddr
vt.addrTo.port = self.dstport