mirror of
https://github.com/codex-storage/nim-codex.git
synced 2025-02-22 09:38:12 +00:00
Attach decode to Manifest
This commit is contained in:
parent
663366a1a9
commit
987a9956ec
@ -131,7 +131,7 @@ proc encode*(b: var BlocksManifest): ?!seq[byte] =
|
||||
|
||||
return pbNode.buffer.success
|
||||
|
||||
proc decode*(_: type BlocksManifest, data: openArray[byte]): ?!Manifest =
|
||||
proc decode*(_: type Manifest, data: openArray[byte]): ?!Manifest =
|
||||
## Decode a manifest from a data blob
|
||||
##
|
||||
|
||||
@ -184,7 +184,7 @@ proc init*(
|
||||
##
|
||||
|
||||
let
|
||||
manifest = ? BlocksManifest.decode(data)
|
||||
manifest = ? Manifest.decode(data)
|
||||
cid = !manifest.cid
|
||||
mhash = ? cid.mhash.mapFailure
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user