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.
Current implementation of .toJSON() produces structure with fields: data, links and size. Which somewhat resembles DAGNode however passing that value into ipld.put stores block with CID QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n corresponding to {} because call to util.serialize looks at the capital cased fields instead
For my specific use case it would be even better if Data and Links getters were just turned into regular properties. That would make it unnecessary to call toJSON at least for my use case.
toJSON() is mostly there for test purpose. It shouldn't really be used. I would've long removed it (as in other codec implementations) if it wouldn't break so much.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Current implementation of
.toJSON()
produces structure with fields:data
,links
andsize
. Which somewhat resemblesDAGNode
however passing that value intoipld.put
stores block with CIDQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n
corresponding to{}
because call toutil.serialize
looks at the capital cased fields insteadjs-ipld-dag-pb/src/serialize.js
Lines 40 to 50 in 1012cad
Which I find really unfortunate, as I was hoping to
toJSON()
for posting nodes across the threads.The text was updated successfully, but these errors were encountered: