Don't touch self.nodes/self.mninfo in llmq-simplepose.py

This commit is contained in:
Alexander Block 2020-03-30 10:39:30 +02:00
parent 908eb8372b
commit a308a092e2

View File

@ -32,15 +32,15 @@ class LLMQSimplePoSeTest(DashTestFramework):
assert(not self.check_punished(mn) and not self.check_banned(mn)) assert(not self.check_punished(mn) and not self.check_banned(mn))
# Now lets kill MNs one by one and verify that punishment/banning happens # Now lets kill MNs one by one and verify that punishment/banning happens
for i in range(len(self.mninfo), len(self.mninfo) - 2, -1): online_mninfos = self.mninfo.copy()
mn = self.mninfo[len(self.mninfo) - 1] for i in range(len(online_mninfos), len(online_mninfos) - 2, -1):
self.mninfo.remove(mn) mn = online_mninfos[len(online_mninfos) - 1]
online_mninfos.remove(mn)
self.stop_node(mn.nodeIdx) self.stop_node(mn.nodeIdx)
self.nodes.remove(mn.node)
t = time.time() t = time.time()
while (not self.check_punished(mn) or not self.check_banned(mn)) and (time.time() - t) < 120: while (not self.check_punished(mn) or not self.check_banned(mn)) and (time.time() - t) < 120:
self.mine_quorum(expected_connections=1, expected_members=i-1, expected_contributions=i-1, expected_complaints=i-1, expected_commitments=i-1) self.mine_quorum(expected_connections=1, expected_members=i-1, expected_contributions=i-1, expected_complaints=i-1, expected_commitments=i-1, mninfos=online_mninfos)
assert(self.check_punished(mn) and self.check_banned(mn)) assert(self.check_punished(mn) and self.check_banned(mn))