mirror of
https://github.com/logos-co/nomos-specs.git
synced 2025-02-12 23:36:29 +00:00
Added block content
This commit is contained in:
parent
25560c076c
commit
ac09aaf9eb
@ -1,5 +1,5 @@
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import TypeAlias, List, Set, Self, Optional, Dict
|
from typing import TypeAlias, List, Set, Self, Optional, Dict, FrozenSet
|
||||||
from abc import abstractmethod
|
from abc import abstractmethod
|
||||||
|
|
||||||
Id: TypeAlias = bytes
|
Id: TypeAlias = bytes
|
||||||
@ -39,6 +39,7 @@ Qc: TypeAlias = StandardQc | AggregateQc
|
|||||||
class Block:
|
class Block:
|
||||||
view: View
|
view: View
|
||||||
qc: Qc
|
qc: Qc
|
||||||
|
content: FrozenSet[Id]
|
||||||
|
|
||||||
def extends(self, ancestor: Self) -> bool:
|
def extends(self, ancestor: Self) -> bool:
|
||||||
"""
|
"""
|
||||||
@ -51,7 +52,7 @@ class Block:
|
|||||||
return self.qc.block
|
return self.qc.block
|
||||||
|
|
||||||
def id(self) -> Id:
|
def id(self) -> Id:
|
||||||
return int_to_id(hash((self.view, self.qc.view, self.qc.block)))
|
return int_to_id(hash(self.content))
|
||||||
|
|
||||||
|
|
||||||
@dataclass(unsafe_hash=True)
|
@dataclass(unsafe_hash=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user