2024-11-06 13:45:37 +01:00

29 lines
446 B
Nim

import ../committee
import ../hashing
type BlockId*[Dependencies] = object
author: CommitteeMember
round: uint64
hash: Hash[Dependencies]
func new*(
T: type BlockId,
author: CommitteeMember,
round: uint64,
hash: Hash
): auto =
T(
author: author,
round: round,
hash: hash
)
func author*(id: BlockId): auto =
id.author
func round*(id: BlockId): uint64 =
id.round
func hash*(blck: BlockId): auto =
blck.hash