Skip to content

Commit cedd3d5

Browse files
committed
refactor: make expected_connections optional
1 parent fd2fbe0 commit cedd3d5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/functional/feature_llmq_simplepose.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def run_test(self):
4545
self.test_no_banning()
4646

4747
# Lets restart masternodes with closed ports and verify that they get banned even though they are connected to other MNs (via outbound connections)
48-
self.test_banning(self.close_mn_port, 3)
48+
self.test_banning(self.close_mn_port)
4949
self.deaf_mns.clear()
5050

5151
self.repair_masternodes(True)
@@ -158,7 +158,7 @@ def mine_quorum_less_checks(self, expected_good_nodes, mninfos_online):
158158

159159
return new_quorum
160160

161-
def test_banning(self, invalidate_proc, expected_connections):
161+
def test_banning(self, invalidate_proc, expected_connections=None):
162162
mninfos_online = self.mninfo.copy()
163163
mninfos_valid = self.mninfo.copy()
164164
expected_contributors = len(mninfos_online)
@@ -173,11 +173,13 @@ def test_banning(self, invalidate_proc, expected_connections):
173173
# NOTE: Min PoSe penalty is 100 (see CDeterministicMNList::CalcMaxPoSePenalty()),
174174
# so nodes are PoSe-banned in the same DKG they misbehave without being PoSe-punished first.
175175
if instant_ban:
176+
assert expected_connections is not None
176177
self.reset_probe_timeouts()
177178
self.mine_quorum(expected_connections=expected_connections, expected_members=expected_contributors, expected_contributions=expected_contributors, expected_complaints=expected_complaints, expected_commitments=expected_contributors, mninfos_online=mninfos_online, mninfos_valid=mninfos_valid)
178179
else:
179180
# It's ok to miss probes/quorum connections up to 5 times.
180181
# 6th time is when it should be banned for sure.
182+
assert expected_connections is None
181183
for _ in range(6):
182184
self.reset_probe_timeouts()
183185
self.mine_quorum_less_checks(expected_contributors - 1, mninfos_online)

0 commit comments

Comments
 (0)