diff options
author | Jon Atack <jon@atack.com> | 2020-08-27 15:10:15 +0200 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2020-08-28 20:12:02 +0200 |
commit | 7984c39be11ca04460883365e1ae2a496aaa6c0e (patch) | |
tree | 755a86c06c556e5263e4e3aa2165b9fea7f7692d | |
parent | 407175e0c2bc797599ebd9c0a1f2ec89ad7af136 (diff) |
test framework: serialize/deserialize inv type as unsigned int
-rwxr-xr-x | test/functional/test_framework/messages.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/functional/test_framework/messages.py b/test/functional/test_framework/messages.py index bd4a53876e..3b20c88fb0 100755 --- a/test/functional/test_framework/messages.py +++ b/test/functional/test_framework/messages.py @@ -244,8 +244,8 @@ class CInv: MSG_TX | MSG_WITNESS_FLAG: "WitnessTx", MSG_BLOCK | MSG_WITNESS_FLAG: "WitnessBlock", MSG_FILTERED_BLOCK: "filtered Block", - 4: "CompactBlock", - 5: "WTX", + MSG_CMPCT_BLOCK: "CompactBlock", + MSG_WTX: "WTX", } def __init__(self, t=0, h=0): @@ -253,12 +253,12 @@ class CInv: self.hash = h def deserialize(self, f): - self.type = struct.unpack("<i", f.read(4))[0] + self.type = struct.unpack("<I", f.read(4))[0] self.hash = deser_uint256(f) def serialize(self): r = b"" - r += struct.pack("<i", self.type) + r += struct.pack("<I", self.type) r += ser_uint256(self.hash) return r |