Skip to content

Commit

Permalink
chore: update ipld-dag-pb to the latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Sep 23, 2019
1 parent 641c28c commit eedd1bc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions src/dag/put.js
Original file line number Diff line number Diff line change
@@ -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')
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/object/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/dag.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit eedd1bc

Please sign in to comment.