Skip to content

Commit 7984c39

Browse files
committed
test framework: serialize/deserialize inv type as unsigned int
1 parent 407175e commit 7984c39

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/functional/test_framework/messages.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,21 +244,21 @@ class CInv:
244244
MSG_TX | MSG_WITNESS_FLAG: "WitnessTx",
245245
MSG_BLOCK | MSG_WITNESS_FLAG: "WitnessBlock",
246246
MSG_FILTERED_BLOCK: "filtered Block",
247-
4: "CompactBlock",
248-
5: "WTX",
247+
MSG_CMPCT_BLOCK: "CompactBlock",
248+
MSG_WTX: "WTX",
249249
}
250250

251251
def __init__(self, t=0, h=0):
252252
self.type = t
253253
self.hash = h
254254

255255
def deserialize(self, f):
256-
self.type = struct.unpack("<i", f.read(4))[0]
256+
self.type = struct.unpack("<I", f.read(4))[0]
257257
self.hash = deser_uint256(f)
258258

259259
def serialize(self):
260260
r = b""
261-
r += struct.pack("<i", self.type)
261+
r += struct.pack("<I", self.type)
262262
r += ser_uint256(self.hash)
263263
return r
264264

0 commit comments

Comments
 (0)