Skip to content

Commit faa5a7a

Browse files
author
MacroFake
committed
test: Check msg type in msg capture is followed by zeros
1 parent dd9f61a commit faa5a7a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

test/functional/p2p_message_capture.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,8 @@ def mini_parser(dat_file):
4343
break
4444
tmp_header = BytesIO(tmp_header_raw)
4545
tmp_header.read(TIME_SIZE) # skip the timestamp field
46-
raw_msgtype = tmp_header.read(MSGTYPE_SIZE)
47-
msgtype: bytes = raw_msgtype.split(b'\x00', 1)[0]
48-
remainder = raw_msgtype.split(b'\x00', 1)[1]
49-
assert(len(msgtype) > 0)
46+
msgtype = tmp_header.read(MSGTYPE_SIZE).rstrip(b'\x00')
5047
assert(msgtype in MESSAGEMAP)
51-
assert(len(remainder) == 0 or not remainder.decode().isprintable())
5248
length: int = int.from_bytes(tmp_header.read(LENGTH_SIZE), "little")
5349
data = f_in.read(length)
5450
assert_equal(len(data), length)

0 commit comments

Comments
 (0)