Remove unnecessary entry encoding step

This commit is contained in:
haad
2024-04-17 12:55:48 +03:00
parent 7ff642be86
commit e6afa0b7e7

View File

@@ -147,8 +147,13 @@ const isEqual = (a, b) => {
* @private
*/
const decode = async (bytes) => {
const { value } = await Block.decode({ bytes, codec, hasher })
return encode(value)
const { cid, value } = await Block.decode({ bytes, codec, hasher })
const hash = cid.toString(hashStringEncoding)
return {
...value,
hash,
bytes
}
}
/**