-
Notifications
You must be signed in to change notification settings - Fork 124
test(dag): add test to verify put API overrides hash algorithm #323
Conversation
@alanshaw let me know if this is what you've been looking for. I can also rebase this on top of ipld/js-ipld#133 so we don't have to introduce this test and skip it at the same time. |
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.
@PascalPrecht 🙌 yes! One thing though, the skip should be removed from here and added to js-ipfs here with some appropriate reason text.
There shouldn't be a need to skip it for js-ipfs-api
as these tests run against go-ipfs
- hopefully they'll pass 😆
@alanshaw sure I can move it over. Just for clarification, in ipfs/js-ipfs#1419 (comment) you said
So that was simply confused with |
The test should stay here, just the instruction to skip should be moved to js-ipfs e.g. https://github.com/ipfs/js-ipfs/blob/master/test/core/interface.spec.js#L27-L30. My point was just that js-ipfs and js-ipfs-api use this same module and we should only need to skip this test in js-ipfs. |
Ah now I get it. Phew.. this orchestration of 3+ repo dependencies can be quite confusing 😅 |
As discussed in ipfs/js-ipfs#1419 (comment) at the time of this commit, `dag.put()` basically ignores the `hashAlg` option, as it passes it down to `ipld.put()`, which won't honor it until ipld/js-ipld#133 is merged. Once ipld/js-ipld#133 is merged, this test verifies that e.g. ``` dag.put(cborNode, { format: 'dag-cbor', hashAlg: 'sha3-512' }, (err, cid) => { ... }) ``` Actually results in a `CID` instance that decodes to `sha3-512` and not the `sha2-256` default. License: MIT Signed-off-by: Pascal Precht [email protected]
404b929
to
3b33c1a
Compare
Over at ipfs-inactive/interface-js-ipfs-core#323 we introduce a test spec that ensures `dag.put()` honors the `hashAlg` option, which at the time of this commit is ignored by the underlying `ipld.put()` API (more info: ipfs@1a36375). This commit skips that spec in `js-ipfs` as ipld/js-ipld#133 has to land first to fulfill the scenario. License: MIT Signed-off-by: Pascal Precht <[email protected]>
@alanshaw updated this PR and moved the skip over to ipfs/js-ipfs#1421 |
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 - did you run the js-ipfs-api tests with this to check that it works on go-ipfs?
Over at ipfs-inactive/interface-js-ipfs-core#323 we introduce a test spec that ensures `dag.put()` honors the `hashAlg` option, which at the time of this commit is ignored by the underlying `ipld.put()` API (more info: ipfs@1a36375). This commit skips that spec in `js-ipfs` as ipld/js-ipld#133 has to land first to fulfill the scenario. License: MIT Signed-off-by: Pascal Precht <[email protected]>
Double-checking in this very moment. |
Looks like you might not have the latest js-ipfs-api? |
Ah sorry. |
Oh, please checkout master on js-ipfs-api and git pull...that should fix you up. |
hmm, can we unskip it in js-ipfs or is it still failing? |
This is still failing in Also notice that the test that's supposed to be skipped in |
Over at ipfs-inactive/interface-js-ipfs-core#323 we introduce a test spec that ensures `dag.put()` honors the `hashAlg` option, which at the time of this commit is ignored by the underlying `ipld.put()` API (more info: 1a36375). This commit skips that spec in `js-ipfs` as ipld/js-ipld#133 has to land first to fulfill the scenario. License: MIT Signed-off-by: Pascal Precht <[email protected]>
As discussed in ipfs/js-ipfs#1419 (comment)
at the time of this commit,
dag.put()
basically ignores thehashAlg
option, as it passes it down to
ipld.put()
, which won't honor it untilipld/js-ipld#133 is merged.
Once ipld/js-ipld#133 is merged, this test verifies
that e.g.
Actually results in a
CID
instance that decodes tosha3-512
and notthe
sha2-256
default.License: MIT
Signed-off-by: Pascal Precht [email protected]