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

Commit 672f11b

Browse files
committed
chore: fix tests
1 parent 31a2b4a commit 672f11b

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

packages/ipfs-core/src/components/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ const initOptions = ({ init }) =>
248248
* @param {IPFS} ipfs
249249
*/
250250
const addEmptyDir = async (ipfs) => {
251-
const node = new DAGNode(new UnixFs('directory').marshal())
251+
const node = new DAGNode(new UnixFs({ type: 'directory' }).marshal())
252252
const cid = await ipfs.dag.put(node, {
253253
version: 0,
254254
format: multicodec.DAG_PB,

packages/ipfs-core/src/components/object/new.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module.exports = ({ ipld, preload }) => {
2323

2424
if (options.template) {
2525
if (options.template === 'unixfs-dir') {
26-
data = (new Unixfs('directory')).marshal()
26+
data = (new Unixfs({ type: 'directory' })).marshal()
2727
} else {
2828
throw new Error('unknown template')
2929
}

packages/ipfs-core/src/components/refs/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ async function getLinks (ipld, cid) {
156156
const node = await ipld.get(new CID(cid))
157157

158158
if (node instanceof DAGNode) {
159-
return node.Links.map(({ Name, Hash }) => ({ name: Name, cid: new CID(Hash) }))
159+
return node.Links.map(({ Name, Hash }) => ({ name: Name, cid: Hash }))
160160
}
161161

162162
return getNodeLinks(node)

packages/ipfs-core/src/runtime/ipld.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module.exports = (blockService, options = {}, log) => {
2222
{ concatArrays: true },
2323
{
2424
blockService: blockService,
25+
formats: [],
2526
loadFormat: (codec) => {
2627
log('Loading IPLD format', codec)
2728
if (IpldFormats[codec]) {

0 commit comments

Comments
 (0)