You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.
Calling ipld.get() should never result in the direct, deserialized value from a resolver’s util.deserialize() function. It should instead result in the equivalent of resolving the path / if no path is provided.
Right now, we explicitly return the result of resolver.util.deserialize(rawBlockData) if no path is specified:
(where ipld._get(cid) is just a wrapper for getResolverForCid(cid).util.deserialize(rawData))
Instead, we should always call resolver.resolver.resolve(rawBlockData, path) as part of ipld.get(), and the path we pass to the resolver should be / if no path was specified as an argument to ipld.get().
This is because get() should always return an object where the keys reflect paths that could be resolved — i.e. the IPLD focused concept of the DAG node, not some other underlying representation, like a BitcoinjsBlock from the Bitcoin library, for example. See the discussion in #141 for more about this.
The text was updated successfully, but these errors were encountered:
With version 0.23 that's the case now. Though get() might have additional methods attached. This means that get() possible returns a superset of resolve('/') (or the same).
Calling
ipld.get()
should never result in the direct, deserialized value from a resolver’sutil.deserialize()
function. It should instead result in the equivalent of resolving the path/
if no path is provided.Right now, we explicitly return the result of
resolver.util.deserialize(rawBlockData)
if no path is specified:js-ipld/src/index.js
Lines 138 to 148 in c81882e
(where
ipld._get(cid)
is just a wrapper forgetResolverForCid(cid).util.deserialize(rawData)
)Instead, we should always call
resolver.resolver.resolve(rawBlockData, path)
as part ofipld.get()
, and thepath
we pass to the resolver should be/
if no path was specified as an argument toipld.get()
.This is because
get()
should always return an object where the keys reflect paths that could be resolved — i.e. the IPLD focused concept of the DAG node, not some other underlying representation, like aBitcoinjsBlock
from the Bitcoin library, for example. See the discussion in #141 for more about this.The text was updated successfully, but these errors were encountered: