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

Commit

Permalink
refactor: only use low-level block api in refs-local interface test
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
achingbrain committed Apr 24, 2020
1 parent d2579c0 commit 99c3be5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/interface-ipfs-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@
"dirty-chai": "^2.0.1",
"ipfs-block": "^0.8.1",
"ipfs-unixfs": "^1.0.1",
"ipfs-unixfs-importer": "^2.0.0",
"ipfs-utils": "^2.2.0",
"ipld-dag-cbor": "^0.15.1",
"ipld-dag-pb": "^0.18.3",
"is-ipfs": "^1.0.0",
"iso-random-stream": "^1.1.1",
"it-all": "^1.0.1",
"it-concat": "^1.0.0",
"it-drain": "^1.0.0",
"it-last": "^1.0.1",
"it-pushable": "^1.3.1",
"multiaddr": "^7.2.1",
Expand Down
4 changes: 3 additions & 1 deletion packages/interface-ipfs-core/src/refs-local.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
const { fixtures } = require('./utils')
const { getDescribe, getIt, expect } = require('./utils/mocha')
const all = require('it-all')
const drain = require('it-drain')
const importer = require('ipfs-unixfs-importer')

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

await all(ipfs.add(dirs))
await drain(importer(dirs, ipfs.block))

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

Expand Down

0 comments on commit 99c3be5

Please sign in to comment.