Added block content

This commit is contained in:
danielsanchezq 2023-04-03 13:49:43 +02:00
parent 25560c076c
commit ac09aaf9eb

View File

@ -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)