Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix: use "ipld" instead of "ipld-resolver"
Browse files Browse the repository at this point in the history
The "ipld-resolver" has been renamed to just "ipld".
  • Loading branch information
vmx authored and daviddias committed Feb 27, 2018
1 parent 7f69628 commit e7f0432
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"ipfs-repo": "~0.18.7",
"ipfs-unixfs": "~0.1.14",
"ipfs-unixfs-engine": "~0.24.2",
"ipld-resolver": "~0.14.1",
"ipld": "^0.15.0",
"is-ipfs": "^0.3.2",
"is-stream": "^1.1.0",
"joi": "^13.1.2",
Expand Down
6 changes: 3 additions & 3 deletions src/core/components/dag.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const pull = require('pull-stream')
module.exports = function dag (self) {
return {
put: promisify((dagNode, options, callback) => {
self._ipldResolver.put(dagNode, options, callback)
self._ipld.put(dagNode, options, callback)
}),

get: promisify((cid, path, options, callback) => {
Expand Down Expand Up @@ -35,7 +35,7 @@ module.exports = function dag (self) {
}
}

self._ipldResolver.get(cid, path, options, callback)
self._ipld.get(cid, path, options, callback)
}),

tree: promisify((cid, path, options, callback) => {
Expand Down Expand Up @@ -70,7 +70,7 @@ module.exports = function dag (self) {
}

pull(
self._ipldResolver.treeStream(cid, path, options),
self._ipld.treeStream(cid, path, options),
pull.collect(callback)
)
})
Expand Down
12 changes: 6 additions & 6 deletions src/core/components/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ module.exports = function files (self) {
return pull(
pull.map(normalizeContent),
pull.flatten(),
importer(self._ipldResolver, opts),
importer(self._ipld, opts),
pull.asyncMap(prepareFile.bind(null, self, opts))
)
}
Expand All @@ -139,7 +139,7 @@ module.exports = function files (self) {
const d = deferred.source()

pull(
exporter(ipfsPath, self._ipldResolver),
exporter(ipfsPath, self._ipld),
pull.collect((err, files) => {
if (err) { return d.abort(err) }
if (files && files.length > 1) {
Expand Down Expand Up @@ -168,7 +168,7 @@ module.exports = function files (self) {
const maxDepth = recursive ? global.Infinity : pathDepth

return pull(
exporter(ipfsPath, self._ipldResolver, { maxDepth: maxDepth }),
exporter(ipfsPath, self._ipld, { maxDepth: maxDepth }),
pull.filter(node =>
recursive ? node.depth >= pathDepth : node.depth === pathDepth
),
Expand Down Expand Up @@ -245,7 +245,7 @@ module.exports = function files (self) {

get: promisify((ipfsPath, callback) => {
pull(
exporter(ipfsPath, self._ipldResolver),
exporter(ipfsPath, self._ipld),
pull.asyncMap((file, cb) => {
if (file.content) {
pull(
Expand All @@ -267,7 +267,7 @@ module.exports = function files (self) {
getReadableStream: (ipfsPath) => {
return toStream.source(
pull(
exporter(ipfsPath, self._ipldResolver),
exporter(ipfsPath, self._ipld),
pull.map((file) => {
if (file.content) {
file.content = toStream.source(file.content)
Expand All @@ -281,7 +281,7 @@ module.exports = function files (self) {
},

getPullStream: (ipfsPath) => {
return exporter(ipfsPath, self._ipldResolver)
return exporter(ipfsPath, self._ipld)
},

lsImmutable: promisify((ipfsPath, options, callback) => {
Expand Down
2 changes: 1 addition & 1 deletion src/core/components/init-assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = function addDefaultAssets (self, log, callback) {
}),
// Filter out directories, which are undefined from above
pull.filter(Boolean),
importer(self._ipldResolver),
importer(self._ipld),
pull.through((el) => {
if (el.path === 'init-docs') {
const cid = new CID(el.multihash)
Expand Down
8 changes: 4 additions & 4 deletions src/core/components/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ module.exports = function object (self) {
if (err) {
return cb(err)
}
self._ipldResolver.put(node, {
self._ipld.put(node, {
cid: new CID(node.multihash)
}, (err) => {
cb(err, node)
Expand Down Expand Up @@ -111,7 +111,7 @@ module.exports = function object (self) {
if (err) {
return callback(err)
}
self._ipldResolver.put(node, {
self._ipld.put(node, {
cid: new CID(node.multihash)
}, (err) => {
if (err) {
Expand Down Expand Up @@ -166,7 +166,7 @@ module.exports = function object (self) {
}

function next () {
self._ipldResolver.put(node, {
self._ipld.put(node, {
cid: new CID(node.multihash)
}, (err) => {
if (err) {
Expand All @@ -193,7 +193,7 @@ module.exports = function object (self) {
}
const cid = new CID(mh)

self._ipldResolver.get(cid, (err, result) => {
self._ipld.get(cid, (err, result) => {
if (err) {
return callback(err)
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const BlockService = require('ipfs-block-service')
const IPLDResolver = require('ipld-resolver')
const Ipld = require('ipld')
const PeerId = require('peer-id')
const PeerInfo = require('peer-info')
const multiaddr = require('multiaddr')
Expand Down Expand Up @@ -68,7 +68,7 @@ class IPFS extends EventEmitter {
this._libp2pNode = undefined
this._bitswap = undefined
this._blockService = new BlockService(this._repo)
this._ipldResolver = new IPLDResolver(this._blockService)
this._ipld = new Ipld(this._blockService)
this._pubsub = undefined

// IPFS Core exposed components
Expand Down
2 changes: 1 addition & 1 deletion src/http/api/resources/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ exports.ls = {
const rootDepth = subpaths.length

pull(
exporter(path, ipfs._ipldResolver, { maxDepth: rootDepth + 1 }),
exporter(path, ipfs._ipld, { maxDepth: rootDepth + 1 }),
pull.collect((err, files) => {
if (err) {
return reply({
Expand Down

0 comments on commit e7f0432

Please sign in to comment.