Update build timeout qc test

This commit is contained in:
danielsanchezq 2023-04-03 11:09:11 +02:00
parent 00b650255c
commit 25560c076c

View File

@ -201,10 +201,6 @@ def download(view) -> Block:
raise NotImplementedError
def build_timeout_qc(msgs) -> TimeoutQc:
pass
class Carnot:
def __init__(self, _id: Id):
self.id: Id = _id
@ -318,7 +314,7 @@ class Carnot:
for child_committee in self.overlay.child_of_root_committee():
self.send(timeout_msg, child_committee)
def timeout(self, msgs: Set["Timeout"]):
def timeout(self, msgs: Set[Timeout]):
assert len(msgs) == self.overlay.super_majority_threshold(self.id)
assert all(msg.view == msgs.pop().view for msg in msgs)
assert msgs.pop().view > self.current_view
@ -326,12 +322,12 @@ class Carnot:
if self.local_high_qc.view < max_msg.high_qc.view:
self.update_high_qc(max_msg.high_qc)
if self.overlay.member_of_root_committee(self.id) and self.overlay.member_of_leaf_committee(self.id):
timeout_qc = build_timeout_qc(msgs)
timeout_qc = self.build_timeout_qc(msgs)
self.update_timeout_qc(timeout_qc)
else:
self.update_timeout_qc(msgs.pop().timeout_qc)
def timeout_qc(self,timeout_qc: TimeoutQc):
def build_timeout_qc(self, msgs: Set[Timeout]) -> TimeoutQc:
pass
def send(self, vote: Vote | Timeout, *ids: Id):