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

Commit 99c3be5

Browse files
committed
refactor: only use low-level block api in refs-local interface test
Follows on from #2980 but uses the unixfs-importer which has been refactored to only use the block API, allowing implementations to be written from low-level APIs upwards.
1 parent d2579c0 commit 99c3be5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/interface-ipfs-core/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@
3838
"dirty-chai": "^2.0.1",
3939
"ipfs-block": "^0.8.1",
4040
"ipfs-unixfs": "^1.0.1",
41+
"ipfs-unixfs-importer": "^2.0.0",
4142
"ipfs-utils": "^2.2.0",
4243
"ipld-dag-cbor": "^0.15.1",
4344
"ipld-dag-pb": "^0.18.3",
4445
"is-ipfs": "^1.0.0",
4546
"iso-random-stream": "^1.1.1",
4647
"it-all": "^1.0.1",
4748
"it-concat": "^1.0.0",
49+
"it-drain": "^1.0.0",
4850
"it-last": "^1.0.1",
4951
"it-pushable": "^1.3.1",
5052
"multiaddr": "^7.2.1",

packages/interface-ipfs-core/src/refs-local.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
const { fixtures } = require('./utils')
55
const { getDescribe, getIt, expect } = require('./utils/mocha')
66
const all = require('it-all')
7+
const drain = require('it-drain')
8+
const importer = require('ipfs-unixfs-importer')
79

810
/** @typedef { import("ipfsd-ctl/src/factory") } Factory */
911
/**
@@ -36,7 +38,7 @@ module.exports = (common, options) => {
3638
content('holmes.txt')
3739
]
3840

39-
await all(ipfs.add(dirs))
41+
await drain(importer(dirs, ipfs.block))
4042

4143
const refs = await all(ipfs.refs.local())
4244

0 commit comments

Comments
 (0)