diff options
author | fanquake <fanquake@gmail.com> | 2021-02-08 10:24:50 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2021-02-08 13:24:44 +0800 |
commit | 9913419cc9db5f8ce7afa0c3774468c330136064 (patch) | |
tree | f063b8de6dd2e3e3591910f91a7395a9288b4c7c /test/functional/p2p_message_capture.py | |
parent | cf26ca3911f3c9ad1583716075b6dd07b76e3ff0 (diff) | |
download | bitcoin-9913419cc9db5f8ce7afa0c3774468c330136064.tar.xz |
test: remove type: comments in favour of actual annotations
Now that we require Python 3.6+, we should be using variable type
annotations directly rather than # type: comments.
Also takes care of the discarded value issue in p2p_message_capture.py.
See: https://github.com/bitcoin/bitcoin/pull/19509/files#r571674446.
Diffstat (limited to 'test/functional/p2p_message_capture.py')
-rwxr-xr-x | test/functional/p2p_message_capture.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/functional/p2p_message_capture.py b/test/functional/p2p_message_capture.py index 113e26c425..080b2d93ad 100755 --- a/test/functional/p2p_message_capture.py +++ b/test/functional/p2p_message_capture.py @@ -42,14 +42,14 @@ def mini_parser(dat_file): if not tmp_header_raw: break tmp_header = BytesIO(tmp_header_raw) - int.from_bytes(tmp_header.read(TIME_SIZE), "little") # type: int + tmp_header.read(TIME_SIZE) # skip the timestamp field raw_msgtype = tmp_header.read(MSGTYPE_SIZE) - msgtype = raw_msgtype.split(b'\x00', 1)[0] # type: bytes + msgtype: bytes = raw_msgtype.split(b'\x00', 1)[0] remainder = raw_msgtype.split(b'\x00', 1)[1] assert(len(msgtype) > 0) assert(msgtype in MESSAGEMAP) assert(len(remainder) == 0 or not remainder.decode().isprintable()) - length = int.from_bytes(tmp_header.read(LENGTH_SIZE), "little") # type: int + length: int = int.from_bytes(tmp_header.read(LENGTH_SIZE), "little") data = f_in.read(length) assert_equal(len(data), length) |