Skip to content

Commit 0647d06

Browse files
authored
Merge pull request ipfs#1115 from ipfs/update-ipld-dag-pb
chore: update ipld-dag-pb to the latest version
2 parents c2bbfae + eedd1bc commit 0647d06

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

Diff for: package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"ipfs-block": "~0.8.1",
6464
"ipfs-utils": "^0.4.0",
6565
"ipld-dag-cbor": "~0.15.0",
66-
"ipld-dag-pb": "~0.17.3",
66+
"ipld-dag-pb": "^0.18.1",
6767
"ipld-raw": "^4.0.0",
6868
"is-ipfs": "~0.6.1",
6969
"is-pull-stream": "0.0.0",
@@ -109,7 +109,7 @@
109109
"cross-env": "^6.0.0",
110110
"dirty-chai": "^2.0.1",
111111
"go-ipfs-dep": "^0.4.22",
112-
"interface-ipfs-core": "~0.114.0",
112+
"interface-ipfs-core": "ipfs/interface-js-ipfs-core#update-dag-pb",
113113
"ipfsd-ctl": "^0.47.1",
114114
"nock": "^11.3.2",
115115
"stream-equal": "^1.1.1"

Diff for: src/dag/put.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict'
22

3-
const dagPB = require('ipld-dag-pb')
43
const dagCBOR = require('ipld-dag-cbor')
54
const promisify = require('promisify-es6')
65
const CID = require('cids')
@@ -56,7 +55,7 @@ module.exports = (send) => {
5655
if (options.format === 'dag-cbor') {
5756
serialized = dagCBOR.util.serialize(dagNode)
5857
} else if (options.format === 'dag-pb') {
59-
serialized = dagPB.util.serialize(dagNode)
58+
serialized = dagNode.serialize()
6059
} else {
6160
// FIXME Hopefully already serialized...can we use IPLD to serialise instead?
6261
serialized = dagNode

Diff for: src/object/get.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ module.exports = (send) => {
4848
}
4949

5050
const links = result.Links.map(l => new DAGLink(l.Name, l.Size, l.Hash))
51-
const node = DAGNode.create(Buffer.from(result.Data, 'base64'), links)
51+
const node = new DAGNode(Buffer.from(result.Data, 'base64'), links)
5252

5353
cache.set(cidB58Str, node)
5454
callback(null, node)

Diff for: test/dag.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ describe('.dag', function () {
3737

3838
it('should be able to put and get a DAG node with format dag-pb', async () => {
3939
const data = Buffer.from('some data')
40-
const node = DAGNode.create(data)
40+
const node = new DAGNode(data)
4141

4242
let cid = await ipfs.dag.put(node, { format: 'dag-pb', hashAlg: 'sha2-256' })
4343
cid = cid.toV0()

0 commit comments

Comments
 (0)