mirror of
https://github.com/logos-storage/logos-storage-nim-validator.git
synced 2026-01-03 14:03:07 +00:00
16 lines
281 B
Nim
16 lines
281 B
Nim
|
|
import ../basics
|
||
|
|
import ./blck
|
||
|
|
import ./blockid
|
||
|
|
import ./serialization
|
||
|
|
import ../hashing
|
||
|
|
|
||
|
|
func id*(blck: Block): BlockId =
|
||
|
|
without var hash =? blck.hash:
|
||
|
|
hash = Hash.hash(blck.toBytes())
|
||
|
|
blck.hash = some hash
|
||
|
|
BlockId.init(
|
||
|
|
blck.author,
|
||
|
|
blck.round,
|
||
|
|
hash
|
||
|
|
)
|