move traces into getCid and getCidAndProof

This commit is contained in:
gmega 2024-02-07 11:22:08 -03:00
parent 6869475283
commit 833172268a
No known key found for this signature in database
GPG Key ID: FFD8DAF00660270F

View File

@ -142,7 +142,9 @@ method getCidAndProof*(
trace "Unable to decode cid and proof", err = err.msg
return failure(err)
trace "Got cid and proof for block", cid, proof = $proof
trace "Got cid and proof for block", treeCid=treeCid, index=index,
cid, proof = $proof
return success (cid, proof)
method getCid*(
@ -160,6 +162,9 @@ method getCid*(
trace "Error getting cid from datastore", err = err.msg, key
return failure(err)
trace "Got cid for block", treeCid=treeCid, index=index,
cid, proof = $proof
return (Cid, CodexProof).decodeCid(value)
method getBlock*(self: RepoStore, cid: Cid): Future[?!Block] {.async.} =
@ -203,9 +208,6 @@ method getBlock*(self: RepoStore, treeCid: Cid, index: Natural): Future[?!Block]
without cid =? await self.getCid(treeCid, index), err:
return failure(err)
trace "Mapped tree cid and index into block cid", treeCid=treeCid,
index=index, cid=cid
await self.getBlock(cid)
method getBlock*(self: RepoStore, address: BlockAddress): Future[?!Block] =