mirror of
https://github.com/logos-blockchain/logos-blockchain-specs.git
synced 2026-01-07 23:53:11 +00:00
Store just highest qc and aggregated views in AggregatedQc,
This commit is contained in:
parent
345c37f234
commit
9a65a7b9c5
@ -22,14 +22,16 @@ class StandardQc:
|
|||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class AggregateQc:
|
class AggregateQc:
|
||||||
qcs: List[StandardQc]
|
qcs: List[View]
|
||||||
|
highest_qc: StandardQc
|
||||||
view: View
|
view: View
|
||||||
|
|
||||||
def view(self) -> View:
|
def view(self) -> View:
|
||||||
return self.view
|
return self.view
|
||||||
|
|
||||||
def high_qc(self) -> StandardQc:
|
def high_qc(self) -> StandardQc:
|
||||||
return max(self.qcs, key=lambda qc: qc.view)
|
assert self.highest_qc.view == max(self.qcs)
|
||||||
|
return self.highest_qc
|
||||||
|
|
||||||
|
|
||||||
Qc: TypeAlias = StandardQc | AggregateQc
|
Qc: TypeAlias = StandardQc | AggregateQc
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user