mirror of
https://github.com/logos-blockchain/logos-blockchain-specs.git
synced 2026-05-22 17:19:58 +00:00
Data classes
This commit is contained in:
parent
4e9946b548
commit
f5d27cd5ca
@ -1,5 +1,5 @@
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Union, List, Set
|
from typing import Union, List, Set, Optional
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
|
|
||||||
Id = bytes
|
Id = bytes
|
||||||
@ -66,3 +66,20 @@ class Block:
|
|||||||
|
|
||||||
def id(self) -> Id:
|
def id(self) -> Id:
|
||||||
return self._id
|
return self._id
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass(unsafe_hash=True)
|
||||||
|
class Vote:
|
||||||
|
block: Id
|
||||||
|
view: View
|
||||||
|
voter: Id
|
||||||
|
qc: Optional[Qc]
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class TimeoutQc:
|
||||||
|
view: View
|
||||||
|
high_qc: Qc
|
||||||
|
qc_views: List[View]
|
||||||
|
sender_ids: Set[Id]
|
||||||
|
sender: Id
|
||||||
Loading…
x
Reference in New Issue
Block a user