-
Notifications
You must be signed in to change notification settings - Fork 109
Conversation
License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
The CID version agnostic tests ipfs-inactive/interface-js-ipfs-core#413 identified some functions were not properly serializing CID instances. This PR adds `cleanCID` step to several functions and also updates the `cleanCID` function to not assume buffer CIDs are CIDv0 multihashes. depends on ipfs-inactive/interface-js-ipfs-core#413 License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
js/src/block/get.js
Outdated
@@ -4,6 +4,7 @@ | |||
const multihash = require('multihashes') | |||
const CID = require('cids') | |||
const auto = require('async/auto') | |||
const crypto = require('crypto') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do the bytes need to be so random that it requires to add the crypto module (and respective browser polyfill?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, and it's probably faster to just use Date.now()
or Math.random()
. I've removed all instances of crypto
. There's one test that generates lots of random data to ensure it spans multiple dag nodes and I've changed that test to use randombytes
so we don't pull in the whole of crypto
in the browser.
License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
Assuming this PR is gtg now @daviddias - please shout if you have further changes and I'll submit another PR! |
The CID version agnostic tests ipfs-inactive/interface-js-ipfs-core#413 identified some functions were not properly serializing CID instances. This PR adds `cleanCID` step to several functions and also updates the `cleanCID` function to not assume buffer CIDs are CIDv0 multihashes. depends on ipfs-inactive/interface-js-ipfs-core#413 License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
The CID version agnostic tests ipfs-inactive/interface-js-ipfs-core#413 identified some functions were not properly serializing CID instances. This PR adds `cleanCID` step to several functions and also updates the `cleanCID` function to not assume buffer CIDs are CIDv0 multihashes. depends on ipfs-inactive/interface-js-ipfs-core#413 License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai> * fix: disable just the rule we're breaking License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai> * chore: update dependencies License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai> * fix: skip test that go-ipfs cannot pass License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
No description provided.