From eedd1bc82244ad40346d1dc5f7ab00bdce352e97 Mon Sep 17 00:00:00 2001 From: achingbrain Date: Mon, 23 Sep 2019 15:13:09 +0100 Subject: [PATCH] chore: update ipld-dag-pb to the latest version --- package.json | 4 ++-- src/dag/put.js | 3 +-- src/object/get.js | 2 +- test/dag.spec.js | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index b11e359f1e..b2d77bb6a6 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "ipfs-block": "~0.8.1", "ipfs-utils": "^0.4.0", "ipld-dag-cbor": "~0.15.0", - "ipld-dag-pb": "~0.17.3", + "ipld-dag-pb": "^0.18.1", "ipld-raw": "^4.0.0", "is-ipfs": "~0.6.1", "is-pull-stream": "0.0.0", @@ -108,7 +108,7 @@ "cross-env": "^6.0.0", "dirty-chai": "^2.0.1", "go-ipfs-dep": "^0.4.22", - "interface-ipfs-core": "~0.114.0", + "interface-ipfs-core": "ipfs/interface-js-ipfs-core#update-dag-pb", "ipfsd-ctl": "^0.47.1", "nock": "^11.3.2", "stream-equal": "^1.1.1" diff --git a/src/dag/put.js b/src/dag/put.js index 6cfca99c0e..36da9376ad 100644 --- a/src/dag/put.js +++ b/src/dag/put.js @@ -1,6 +1,5 @@ 'use strict' -const dagPB = require('ipld-dag-pb') const dagCBOR = require('ipld-dag-cbor') const promisify = require('promisify-es6') const CID = require('cids') @@ -56,7 +55,7 @@ module.exports = (send) => { if (options.format === 'dag-cbor') { serialized = dagCBOR.util.serialize(dagNode) } else if (options.format === 'dag-pb') { - serialized = dagPB.util.serialize(dagNode) + serialized = dagNode.serialize() } else { // FIXME Hopefully already serialized...can we use IPLD to serialise instead? serialized = dagNode diff --git a/src/object/get.js b/src/object/get.js index 1450c37922..5052c8af3a 100644 --- a/src/object/get.js +++ b/src/object/get.js @@ -48,7 +48,7 @@ module.exports = (send) => { } const links = result.Links.map(l => new DAGLink(l.Name, l.Size, l.Hash)) - const node = DAGNode.create(Buffer.from(result.Data, 'base64'), links) + const node = new DAGNode(Buffer.from(result.Data, 'base64'), links) cache.set(cidB58Str, node) callback(null, node) diff --git a/test/dag.spec.js b/test/dag.spec.js index 8796ba72b6..37433836ff 100644 --- a/test/dag.spec.js +++ b/test/dag.spec.js @@ -37,7 +37,7 @@ describe('.dag', function () { it('should be able to put and get a DAG node with format dag-pb', async () => { const data = Buffer.from('some data') - const node = DAGNode.create(data) + const node = new DAGNode(data) let cid = await ipfs.dag.put(node, { format: 'dag-pb', hashAlg: 'sha2-256' }) cid = cid.toV0()