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 was archived by the owner on Mar 10, 2020. It is now read-only.
test(dag): ensure dag.put can be called without options (#316)
* test(dag): introduce test that ensure `dag.put` can be called without options
As discussed in ipfs/js-ipfs#1415 (comment)
* chore(SPEC/DAG): update DAG spec to cover optional `options` argument
License: MIT
Signed-off-by: Pascal Precht <[email protected]>
* test: add test to ensure defaults are set
License: MIT
Signed-off-by: Alan Shaw <[email protected]>
-`dagNode` - a DAG node that follows one of the supported IPLD formats.
18
-
-`options` - a object that might contain the follwing values:
18
+
-`options` - a object that might contain the following values:
19
19
-`format` - The IPLD format multicodec.
20
20
-`hashAlg` - The hash algorithm to be used over the serialized dagNode.
21
21
- or
22
22
-`cid` - the CID of the node passed.
23
+
- or
24
+
- if no `options` are given, `ipfs.dag.put()` uses the following defaults:
25
+
-`format: 'dag-cbor'`
26
+
-`hashAlg: 'sha2-256'`
23
27
-**Note** - You should only pass the CID or the format + hashAlg pair and not both
24
28
-`callback` must follow `function (err, cid) {}` signature, where `err` is an error if the operation was not successful and CID is the CID generated through the process or the one that was passed
0 commit comments