parent
06bb21bfc7
commit
8d61391073
|
@ -96,7 +96,6 @@ proc encode(cidAndProof: (Cid, MerkleProof)): seq[byte] =
|
||||||
proc decode(_: type (Cid, MerkleProof), data: seq[byte]): ?!(Cid, MerkleProof) =
|
proc decode(_: type (Cid, MerkleProof), data: seq[byte]): ?!(Cid, MerkleProof) =
|
||||||
let
|
let
|
||||||
n = uint64.fromBytesBE(data[0..<sizeof(uint64)]).int
|
n = uint64.fromBytesBE(data[0..<sizeof(uint64)]).int
|
||||||
let
|
|
||||||
cid = ? Cid.init(data[sizeof(uint64)..<sizeof(uint64) + n]).mapFailure
|
cid = ? Cid.init(data[sizeof(uint64)..<sizeof(uint64) + n]).mapFailure
|
||||||
proof = ? MerkleProof.decode(data[sizeof(uint64) + n..^1])
|
proof = ? MerkleProof.decode(data[sizeof(uint64) + n..^1])
|
||||||
success((cid, proof))
|
success((cid, proof))
|
||||||
|
|
Loading…
Reference in New Issue