mirror of
https://github.com/logos-co/nomos-specs.git
synced 2025-02-08 21:43:48 +00:00
Added block content
This commit is contained in:
parent
25560c076c
commit
ac09aaf9eb
@ -1,5 +1,5 @@
|
||||
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
|
||||
|
||||
Id: TypeAlias = bytes
|
||||
@ -39,6 +39,7 @@ Qc: TypeAlias = StandardQc | AggregateQc
|
||||
class Block:
|
||||
view: View
|
||||
qc: Qc
|
||||
content: FrozenSet[Id]
|
||||
|
||||
def extends(self, ancestor: Self) -> bool:
|
||||
"""
|
||||
@ -51,7 +52,7 @@ class Block:
|
||||
return self.qc.block
|
||||
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user