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

Commit

Permalink
fix: using the new IPLD API
Browse files Browse the repository at this point in the history
  • Loading branch information
pgte committed Mar 23, 2017
1 parent db25fb9 commit a80f4d8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/exporter/dir-flat.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function dirExporter (node, name, ipldResolver, resolve, parent) {
return cb(err)
}

cb(null, resolve(n, item.path, ipldResolver, name, parent))
cb(null, resolve(n.value, item.path, ipldResolver, name, parent))
})),
pull.flatten()
)
Expand Down
2 changes: 1 addition & 1 deletion src/exporter/dir-hamt-sharded.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function shardedDirExporter (node, name, ipldResolver, resolve, parent) {
return cb(err)
}

cb(null, resolve(n, item.path, ipldResolver, (dir && dir[0]) || parent))
cb(null, resolve(n.value, item.path, ipldResolver, (dir && dir[0]) || parent))
})),
pull.flatten()
)
Expand Down
5 changes: 2 additions & 3 deletions src/exporter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ module.exports = (hash, ipldResolver) => {

return pull(
ipldResolver.getStream(new CID(hash)),
pull.map((node) => {
return resolve(node, hash, ipldResolver)
}),
pull.map((result) => result.value),
pull.map((node) => resolve(node, hash, ipldResolver)),
pull.flatten()
)
}
2 changes: 1 addition & 1 deletion src/importer/dir-flat.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ class DirFlat {
(callback) => DAGNode.create(dir.marshal(), links, callback),
(node, callback) => {
ipldResolver.put(
node,
{
node: node,
cid: new CID(node.multihash)
},
(err) => callback(err, node))
Expand Down
2 changes: 1 addition & 1 deletion src/importer/dir-sharded.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ function flush (options, bucket, path, ipldResolver, source, callback) {
(callback) => DAGNode.create(dir.marshal(), links, callback),
(node, callback) => {
ipldResolver.put(
node,
{
node: node,
cid: new CID(node.multihash)
},
(err) => callback(err, node))
Expand Down

0 comments on commit a80f4d8

Please sign in to comment.