24 lines
488 B
Nim
Raw Permalink Normal View History

2024-12-18 10:19:09 +01:00
from pkg/mysticeti import CommitteeMember, `==`, `$`
2024-12-10 16:10:12 +01:00
import ../basics
2024-12-10 15:47:37 +01:00
import ../transaction
2024-12-10 16:10:12 +01:00
import ../hashing
2024-12-18 10:37:40 +01:00
import ../signatures
2024-12-10 15:47:37 +01:00
import ./blockid
export mysticeti.CommitteeMember
2024-12-10 16:10:12 +01:00
export mysticeti.`==`
2024-12-18 10:19:09 +01:00
export mysticeti.`$`
2024-12-10 15:47:37 +01:00
type Block* = ref object
author*: CommitteeMember
round*: uint64
2024-12-10 16:10:12 +01:00
parents*: seq[BlockId]
2024-12-18 10:37:40 +01:00
transactions*: seq[Signed[Transaction]]
2024-12-16 10:48:52 +01:00
hash: ?Hash
func `hash=`*(blck: Block, hash: Hash) =
blck.hash = some hash
func hash*(blck: Block): ?Hash =
blck.hash