mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-01-24 08:13:18 +00:00
cleanup
This commit is contained in:
parent
b0ba10aa8f
commit
b3d3274765
@ -37,10 +37,9 @@ proc toPoseidon2Hash(cid: Cid, mcodec: MultiCodec, cidCodec: MultiCodec): ?!Pose
|
||||
let
|
||||
mhash = ? cid.mhash.mapFailure
|
||||
bytes: array[32, byte] = array[32, byte].initCopyFrom(mhash.digestBytes())
|
||||
hash = Poseidon2Hash.fromBytes(bytes)
|
||||
if not hash.isSome():
|
||||
return failure("Unable to convert Cid to Poseidon2Hash")
|
||||
return success(hash.get())
|
||||
hash = ? Poseidon2Hash.fromBytes(bytes).toFailure
|
||||
|
||||
success hash
|
||||
|
||||
func toCellCid*(hash: Poseidon2Hash): ?!Cid =
|
||||
toCid(hash, Pos2Bn128MrklCodec, CodexSlotCellCodec)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user