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

Commit e93db3e

Browse files
committedFeb 5, 2020
chore: update importer to only output unixfs things
BREAKING CHANGE: If you specify `raw-nodes` to be true or `cid-version` to be `1` and your data fits in one chunk, you would previously get a `CID` that resolves to an `ipld-raw` node. Now you will get a `CID` that resolves to a `dag-pb` node, so the output of every import will be a `unixfs` object.
1 parent cdc7d6b commit e93db3e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed
 

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
"ipfs-repo": "^0.30.0",
106106
"ipfs-unixfs": "^0.3.0",
107107
"ipfs-unixfs-exporter": "^0.41.0",
108-
"ipfs-unixfs-importer": "^0.44.0",
108+
"ipfs-unixfs-importer": "^0.45.0",
109109
"ipfs-utils": "^0.7.1",
110110
"ipld": "~0.25.0",
111111
"ipld-bitcoin": "~0.3.0",

‎test/cli/files.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ describe('files', () => runOnAndOff((thing) => {
218218

219219
const out = await ipfs('add test/fixtures/less-than-default-max-chunk-size --cid-version=1')
220220
expect(out)
221-
.to.eql('added bafkreie3abdlmy7dtxddm4vkbhd2x2yax5scf4m35eyxf3ywj2uwkjbhgi less-than-default-max-chunk-size\n')
221+
.to.eql('added bafybeiaoh5okvpnuhndsz4kgdhulnkm566rz7w7il6r2zm6wxu5f5uqlsu less-than-default-max-chunk-size\n')
222222
})
223223

224224
it('add with cid-version=1 > default max chunk size', async function () {
@@ -250,7 +250,7 @@ describe('files', () => runOnAndOff((thing) => {
250250

251251
const out = await ipfs('add test/fixtures/less-than-default-max-chunk-size --cid-version=1 --raw-leaves=true')
252252
expect(out)
253-
.to.eql('added bafkreie3abdlmy7dtxddm4vkbhd2x2yax5scf4m35eyxf3ywj2uwkjbhgi less-than-default-max-chunk-size\n')
253+
.to.eql('added bafybeiaoh5okvpnuhndsz4kgdhulnkm566rz7w7il6r2zm6wxu5f5uqlsu less-than-default-max-chunk-size\n')
254254
})
255255

256256
it('add with cid-version=1 and raw-leaves=true > default max chunk size', async function () {

‎test/core/files.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ describe('files', function () {
3939
}))
4040

4141
expect(files.length).to.equal(1)
42-
expect(files[0].cid.toString()).to.equal('bafkreifojmzibzlof6xyh5auu3r5vpu5l67brf3fitaf73isdlglqw2t7q')
43-
expect(files[0].size).to.equal(3)
42+
expect(files[0].cid.toString()).to.equal('bafybeide2caf5we5a7izifzwzz5ds2gla67vsfgrzvbzpnyyirnfzgwf5e')
43+
expect(files[0].size).to.equal(11)
4444
})
4545

4646
it('should add a file with a v1 CID and not raw leaves', async () => {

0 commit comments

Comments
 (0)
This repository has been archived.