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

Commit 6aa245f

Browse files
committed
fix: use ipfs.add instead of files.add
1 parent 7319c20 commit 6aa245f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/utils/with-mfs-root.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ const withMfsRoot = (ipfs, callback) => {
2828

2929
return waterfall([
3030
// Store an empty node as the root
31-
(next) => ipfs.files.add({
31+
(next) => ipfs.add({
3232
path: '/'
3333
}, next),
3434
// Turn the hash into a Buffer
35-
([{hash}], next) => next(null, new CID(hash)),
35+
([{ hash }], next) => next(null, new CID(hash)),
3636
(cid, next) => repo.closed ? datastore.open((error) => next(error, cid)) : next(null, cid),
3737
// Store the Buffer in the datastore
3838
(cid, next) => datastore.put(MFS_ROOT_KEY, cid.buffer, (error) => next(error, cid))

0 commit comments

Comments
 (0)