Giter VIP home page Giter VIP logo

Comments (11)

wanderer avatar wanderer commented on June 15, 2024 2

@diasdavid okie! test added

from js-ipld.

daviddias avatar daviddias commented on June 15, 2024 1

@vmx just getting this on your radar :)

from js-ipld.

daviddias avatar daviddias commented on June 15, 2024

Thanks for reporting this bug. It is a fun one indeed!

A simple (and I believe to be the wisest) solution would be to make a copy at the beginning of put, however, that would force us to add a copy function to the interface-ipld-format so that we know how to make a 1:1 copy of any format.

Mind submitting a PR with a test?

from js-ipld.

kumavis avatar kumavis commented on June 15, 2024

Hmm do we need a ipldXResolver.clone method?

from js-ipld.

daviddias avatar daviddias commented on June 15, 2024

@kumavis if we go with that solution, then yes

from js-ipld.

wanderer avatar wanderer commented on June 15, 2024

Hmm do we need a ipldXResolver.clone method?

i think i would argue against it since we have serialize. Which is copying in a sense. If we serialized once then hashed the serialized data instead of serializing twice then invalid blocks coudn't be generated

from js-ipld.

daviddias avatar daviddias commented on June 15, 2024

@wanderer it would work for this case, yes, but getting .copy would prevent other weird scenarios int he future. We can: a) solve this by taking in your proposal -- ipld/interface-ipld-format#7 -- and b) keep considering adding .copy to interface-ipld-format.

from js-ipld.

wanderer avatar wanderer commented on June 15, 2024

@diasdavid in which case would this not work? I can't think of anything off the top of my head. But if there are things that mutate the serialized version somehow then i guess we could aslo specify that serialize does a copy

from js-ipld.

daviddias avatar daviddias commented on June 15, 2024

It will work 👍

from js-ipld.

richardschneider avatar richardschneider commented on June 15, 2024

ipld/interface-ipld-format#32 will resolve this. cid will take the serialised output not the dagNode.

from js-ipld.

vmx avatar vmx commented on June 15, 2024

As cid() is now taking the serialized version of a node, that's not an issue anymore.

from js-ipld.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.