Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit b3dbe45

Browse files
committed
fix: block.get supports multihash as buffers again
1 parent 2b498b9 commit b3dbe45

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@
3131
"glob": "^7.1.1",
3232
"glob-escape": "0.0.2",
3333
"ipfs-block": "^0.5.1",
34-
"ipld-dag-pb": "^0.9.2",
34+
"ipld-dag-pb": "^0.9.3",
3535
"is-ipfs": "^0.2.1",
3636
"isstream": "^0.1.2",
3737
"lru-cache": "^4.0.2",
3838
"multiaddr": "^2.1.1",
3939
"multipart-stream": "^2.0.1",
40-
"ndjson": "^1.4.3",
40+
"ndjson": "^1.5.0",
4141
"once": "^1.4.0",
4242
"peer-id": "^0.8.0",
4343
"peer-info": "^0.8.1",
@@ -59,15 +59,15 @@
5959
"devDependencies": {
6060
"aegir": "^9.1.2",
6161
"chai": "^3.5.0",
62-
"eslint-plugin-react": "^6.7.1",
62+
"eslint-plugin-react": "^6.8.0",
6363
"gulp": "^3.9.1",
6464
"hapi": "^16.0.1",
6565
"interface-ipfs-core": "^0.22.0",
6666
"ipfsd-ctl": "^0.17.0",
6767
"pre-commit": "^1.1.3",
6868
"socket.io": "^1.7.1",
6969
"socket.io-client": "^1.7.1",
70-
"stream-equal": "^0.1.11"
70+
"stream-equal": "^0.1.12"
7171
},
7272
"pre-commit": [
7373
"lint",
@@ -115,4 +115,4 @@
115115
"url": "https://github.com/ipfs/js-ipfs-api/issues"
116116
},
117117
"homepage": "https://github.com/ipfs/js-ipfs-api"
118-
}
118+
}

src/api/block.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ module.exports = (send) => {
1010
return {
1111
get: promisify((args, opts, callback) => {
1212
// TODO this needs to be adjusted with the new go-ipfs http-api
13-
if (args && CID.isCID(args)) {
13+
if (CID.isCID(args)) {
1414
args = multihash.toB58String(args.multihash)
1515
}
16-
if (typeof (opts) === 'function') {
16+
if (Buffer.isBuffer(args)) {
17+
args = multihash.toB58String(args)
18+
}
19+
if (typeof opts === 'function') {
1720
callback = opts
1821
opts = {}
1922
}

0 commit comments

Comments
 (0)