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

Commit e7f0432

Browse files
vmxdaviddias
authored andcommitted
fix: use "ipld" instead of "ipld-resolver"
The "ipld-resolver" has been renamed to just "ipld".
1 parent 7f69628 commit e7f0432

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
"ipfs-repo": "~0.18.7",
116116
"ipfs-unixfs": "~0.1.14",
117117
"ipfs-unixfs-engine": "~0.24.2",
118-
"ipld-resolver": "~0.14.1",
118+
"ipld": "^0.15.0",
119119
"is-ipfs": "^0.3.2",
120120
"is-stream": "^1.1.0",
121121
"joi": "^13.1.2",

src/core/components/dag.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const pull = require('pull-stream')
77
module.exports = function dag (self) {
88
return {
99
put: promisify((dagNode, options, callback) => {
10-
self._ipldResolver.put(dagNode, options, callback)
10+
self._ipld.put(dagNode, options, callback)
1111
}),
1212

1313
get: promisify((cid, path, options, callback) => {
@@ -35,7 +35,7 @@ module.exports = function dag (self) {
3535
}
3636
}
3737

38-
self._ipldResolver.get(cid, path, options, callback)
38+
self._ipld.get(cid, path, options, callback)
3939
}),
4040

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

7272
pull(
73-
self._ipldResolver.treeStream(cid, path, options),
73+
self._ipld.treeStream(cid, path, options),
7474
pull.collect(callback)
7575
)
7676
})

src/core/components/files.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ module.exports = function files (self) {
121121
return pull(
122122
pull.map(normalizeContent),
123123
pull.flatten(),
124-
importer(self._ipldResolver, opts),
124+
importer(self._ipld, opts),
125125
pull.asyncMap(prepareFile.bind(null, self, opts))
126126
)
127127
}
@@ -139,7 +139,7 @@ module.exports = function files (self) {
139139
const d = deferred.source()
140140

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

170170
return pull(
171-
exporter(ipfsPath, self._ipldResolver, { maxDepth: maxDepth }),
171+
exporter(ipfsPath, self._ipld, { maxDepth: maxDepth }),
172172
pull.filter(node =>
173173
recursive ? node.depth >= pathDepth : node.depth === pathDepth
174174
),
@@ -245,7 +245,7 @@ module.exports = function files (self) {
245245

246246
get: promisify((ipfsPath, callback) => {
247247
pull(
248-
exporter(ipfsPath, self._ipldResolver),
248+
exporter(ipfsPath, self._ipld),
249249
pull.asyncMap((file, cb) => {
250250
if (file.content) {
251251
pull(
@@ -267,7 +267,7 @@ module.exports = function files (self) {
267267
getReadableStream: (ipfsPath) => {
268268
return toStream.source(
269269
pull(
270-
exporter(ipfsPath, self._ipldResolver),
270+
exporter(ipfsPath, self._ipld),
271271
pull.map((file) => {
272272
if (file.content) {
273273
file.content = toStream.source(file.content)
@@ -281,7 +281,7 @@ module.exports = function files (self) {
281281
},
282282

283283
getPullStream: (ipfsPath) => {
284-
return exporter(ipfsPath, self._ipldResolver)
284+
return exporter(ipfsPath, self._ipld)
285285
},
286286

287287
lsImmutable: promisify((ipfsPath, options, callback) => {

src/core/components/init-assets.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = function addDefaultAssets (self, log, callback) {
2626
}),
2727
// Filter out directories, which are undefined from above
2828
pull.filter(Boolean),
29-
importer(self._ipldResolver),
29+
importer(self._ipld),
3030
pull.through((el) => {
3131
if (el.path === 'init-docs') {
3232
const cid = new CID(el.multihash)

src/core/components/object.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ module.exports = function object (self) {
8080
if (err) {
8181
return cb(err)
8282
}
83-
self._ipldResolver.put(node, {
83+
self._ipld.put(node, {
8484
cid: new CID(node.multihash)
8585
}, (err) => {
8686
cb(err, node)
@@ -111,7 +111,7 @@ module.exports = function object (self) {
111111
if (err) {
112112
return callback(err)
113113
}
114-
self._ipldResolver.put(node, {
114+
self._ipld.put(node, {
115115
cid: new CID(node.multihash)
116116
}, (err) => {
117117
if (err) {
@@ -166,7 +166,7 @@ module.exports = function object (self) {
166166
}
167167

168168
function next () {
169-
self._ipldResolver.put(node, {
169+
self._ipld.put(node, {
170170
cid: new CID(node.multihash)
171171
}, (err) => {
172172
if (err) {
@@ -193,7 +193,7 @@ module.exports = function object (self) {
193193
}
194194
const cid = new CID(mh)
195195

196-
self._ipldResolver.get(cid, (err, result) => {
196+
self._ipld.get(cid, (err, result) => {
197197
if (err) {
198198
return callback(err)
199199
}

src/core/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict'
22

33
const BlockService = require('ipfs-block-service')
4-
const IPLDResolver = require('ipld-resolver')
4+
const Ipld = require('ipld')
55
const PeerId = require('peer-id')
66
const PeerInfo = require('peer-info')
77
const multiaddr = require('multiaddr')
@@ -68,7 +68,7 @@ class IPFS extends EventEmitter {
6868
this._libp2pNode = undefined
6969
this._bitswap = undefined
7070
this._blockService = new BlockService(this._repo)
71-
this._ipldResolver = new IPLDResolver(this._blockService)
71+
this._ipld = new Ipld(this._blockService)
7272
this._pubsub = undefined
7373

7474
// IPFS Core exposed components

src/http/api/resources/file.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ exports.ls = {
8080
const rootDepth = subpaths.length
8181

8282
pull(
83-
exporter(path, ipfs._ipldResolver, { maxDepth: rootDepth + 1 }),
83+
exporter(path, ipfs._ipld, { maxDepth: rootDepth + 1 }),
8484
pull.collect((err, files) => {
8585
if (err) {
8686
return reply({

0 commit comments

Comments
 (0)