mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-01-03 22:13:12 +00:00
style
This commit is contained in:
parent
071a748766
commit
5eabafac03
@ -39,15 +39,17 @@ func init*(
|
||||
hash = ? MultiHash.digest($mcodec, data).mapFailure
|
||||
cid = ? Cid.init(version, codec, hash).mapFailure
|
||||
|
||||
success Block(
|
||||
# TODO: If the hash is `>=` to the data,
|
||||
# use the Cid as a container!
|
||||
Block(
|
||||
cid: cid,
|
||||
data: @data)
|
||||
data: @data).success
|
||||
|
||||
func init*(
|
||||
T: type Block,
|
||||
cid: Cid,
|
||||
data: openArray[byte],
|
||||
verify: bool = false): ?!T =
|
||||
verify: bool = true): ?!T =
|
||||
|
||||
let
|
||||
mhash = ? cid.mhash.mapFailure
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user