Skip to content

Commit ad90ba3

Browse files
committed
test: refactor: rename inbound to is_inbound
Makes it easier to recognize this variable represents a flag.
1 parent afc0224 commit ad90ba3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/functional/interface_usdt_net.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,19 @@ def __repr__(self):
121121
checked_outbound_version_msg = 0
122122
events = []
123123

124-
def check_p2p_message(event, inbound):
124+
def check_p2p_message(event, is_inbound):
125125
nonlocal checked_inbound_version_msg, checked_outbound_version_msg
126126
if event.msg_type.decode("utf-8") == "version":
127127
self.log.info(
128-
f"check_p2p_message(): {'inbound' if inbound else 'outbound'} {event}")
128+
f"check_p2p_message(): {'inbound' if is_inbound else 'outbound'} {event}")
129129
peer = self.nodes[0].getpeerinfo()[0]
130130
msg = msg_version()
131131
msg.deserialize(BytesIO(bytes(event.msg[:event.msg_size])))
132132
assert_equal(peer["id"], event.peer_id, peer["id"])
133133
assert_equal(peer["addr"], event.peer_addr.decode("utf-8"))
134134
assert_equal(peer["connection_type"],
135135
event.peer_conn_type.decode("utf-8"))
136-
if inbound:
136+
if is_inbound:
137137
checked_inbound_version_msg += 1
138138
else:
139139
checked_outbound_version_msg += 1
@@ -157,8 +157,8 @@ def handle_outbound(_, data, __):
157157

158158
self.log.info(
159159
"check receipt and content of in- and outbound version messages")
160-
for event, inbound in events:
161-
check_p2p_message(event, inbound)
160+
for event, is_inbound in events:
161+
check_p2p_message(event, is_inbound)
162162
assert_equal(EXPECTED_INOUTBOUND_VERSION_MSG,
163163
checked_inbound_version_msg)
164164
assert_equal(EXPECTED_INOUTBOUND_VERSION_MSG,

0 commit comments

Comments
 (0)