aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/messages.py
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2017-11-22 11:45:14 -0500
committerJohn Newbery <john@johnnewbery.com>2018-01-30 09:31:31 -0500
commitc32cf9f62285b5cd18a5064aee91f0802f0f87a8 (patch)
tree41e9fc0adb4a01c4deb9bf44d95885763f65c04f /test/functional/test_framework/messages.py
parentcc046f66a7f3bb8d615998ebce38468d90ad8681 (diff)
[tests] Add P2PDataStore class
P2PDataStore subclasses NodeConnCB. This class keeps a store of txs and blocks and responds to getdata requests from the node-under-test.
Diffstat (limited to 'test/functional/test_framework/messages.py')
-rw-r--r--test/functional/test_framework/messages.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/functional/test_framework/messages.py b/test/functional/test_framework/messages.py
index a54a0299c7..46ef7521e0 100644
--- a/test/functional/test_framework/messages.py
+++ b/test/functional/test_framework/messages.py
@@ -44,6 +44,11 @@ NODE_UNSUPPORTED_SERVICE_BIT_5 = (1 << 5)
NODE_UNSUPPORTED_SERVICE_BIT_7 = (1 << 7)
NODE_NETWORK_LIMITED = (1 << 10)
+MSG_TX = 1
+MSG_BLOCK = 2
+MSG_WITNESS_FLAG = 1 << 30
+MSG_TYPE_MASK = 0xffffffff >> 2
+
# Serialization/deserialization tools
def sha256(s):
return hashlib.new('sha256', s).digest()
@@ -204,8 +209,6 @@ class CAddress():
return "CAddress(nServices=%i ip=%s port=%i)" % (self.nServices,
self.ip, self.port)
-MSG_WITNESS_FLAG = 1<<30
-
class CInv():
typemap = {
0: "Error",