From 70efd13c73c4e876b6b20272336e9dfbe8df8576 Mon Sep 17 00:00:00 2001 From: Tomasz Bekas Date: Mon, 20 Nov 2023 14:48:56 +0100 Subject: [PATCH] Fix block delete by treeCid and index (#623) --- codex/stores/repostore.nim | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/codex/stores/repostore.nim b/codex/stores/repostore.nim index 3343382e..37c54972 100644 --- a/codex/stores/repostore.nim +++ b/codex/stores/repostore.nim @@ -100,6 +100,12 @@ proc decode(_: type (Cid, MerkleProof), data: seq[byte]): ?!(Cid, MerkleProof) = proof = ? MerkleProof.decode(data[sizeof(uint64) + n..^1]) success((cid, proof)) +proc decodeCid(_: type (Cid, MerkleProof), data: seq[byte]): ?!Cid = + let + n = uint64.fromBytesBE(data[0..