Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.

Commit

Permalink
fix: resolvers expect binary data
Browse files Browse the repository at this point in the history
The resolvers no longer expect an IPFS Block, but directly the
binary data of such a block.

Closes: ipld/interface-ipld-format#21
  • Loading branch information
vmx committed Feb 12, 2018
1 parent 11d1eea commit 03eaa25
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@
"ipfs-block": "~0.6.1",
"ipfs-block-service": "~0.13.0",
"ipfs-repo": "~0.18.5",
"ipld-dag-cbor": "~0.11.2",
"ipld-dag-pb": "~0.11.4",
"ipld-ethereum": "^1.4.4",
"ipld-git": "~0.1.1",
"ipld-raw": "^1.0.7",
"ipld-dag-cbor": "~0.12.0",
"ipld-dag-pb": "~0.13.0",
"ipld-ethereum": "^2.0.0",
"ipld-git": "~0.2.0",
"ipld-raw": "^2.0.0",
"is-ipfs": "~0.3.2",
"lodash.flatten": "^4.4.0",
"lodash.includes": "^4.3.0",
Expand Down
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class IPLDResolver {
if (!r) {
return cb(new Error('No resolver found for codec "' + cid.codec + '"'))
}
r.resolver.resolve(block, path, (err, result) => {
r.resolver.resolve(block.data, path, (err, result) => {
if (err) {
return cb(err)
}
Expand Down Expand Up @@ -252,7 +252,7 @@ class IPLDResolver {

waterfall([
(cb) => this.bs.get(cid, cb),
(block, cb) => r.resolver.tree(block, cb)
(block, cb) => r.resolver.tree(block.data, cb)
], (err, paths) => {
if (err) {
p.abort(err)
Expand Down Expand Up @@ -287,12 +287,12 @@ class IPLDResolver {

waterfall([
(cb) => this.bs.get(el.cid, cb),
(block, cb) => r.resolver.tree(block, (err, paths) => {
(block, cb) => r.resolver.tree(block.data, (err, paths) => {
if (err) {
return cb(err)
}
map(paths, (p, cb) => {
r.resolver.isLink(block, p, (err, link) => {
r.resolver.isLink(block.data, p, (err, link) => {
if (err) {
return cb(err)
}
Expand Down

0 comments on commit 03eaa25

Please sign in to comment.