diff --git a/package.json b/package.json index 60d3d8de17..66d2c0dd5c 100644 --- a/package.json +++ b/package.json @@ -114,7 +114,7 @@ "ipfs-multipart": "~0.1.0", "ipfs-repo": "~0.23.1", "ipfs-unixfs": "~0.1.15", - "ipfs-unixfs-engine": "~0.32.1", + "ipfs-unixfs-engine": "~0.32.3", "ipld": "~0.17.3", "ipld-dag-cbor": "~0.12.1", "ipld-dag-pb": "~0.14.6", diff --git a/src/cli/commands/files/add.js b/src/cli/commands/files/add.js index 2547150e91..37732b7ad2 100644 --- a/src/cli/commands/files/add.js +++ b/src/cli/commands/files/add.js @@ -145,7 +145,6 @@ module.exports = { }, 'raw-leaves': { type: 'boolean', - default: false, describe: 'Use raw blocks for leaf nodes. (experimental)' }, 'cid-version': { diff --git a/test/cli/dns.js b/test/cli/dns.js index ae66c6c8c3..0c6ab4e1a5 100644 --- a/test/cli/dns.js +++ b/test/cli/dns.js @@ -16,7 +16,7 @@ describe('dns', () => runOnAndOff((thing) => { this.timeout(60 * 1000) return ipfs('dns ipfs.io').then((res) => { - expect(res.substr(0, 6)).to.eql('/ipfs/') + expect(res.substr(0, 6)).to.eql('/ipns/') }) }) })) diff --git a/test/cli/files.js b/test/cli/files.js index fda9c2de94..69843145e6 100644 --- a/test/cli/files.js +++ b/test/cli/files.js @@ -205,33 +205,63 @@ describe('files', () => runOnAndOff((thing) => { }) }) - it('add with cid-version=1', function () { + it('add with cid-version=1 < default max chunk size', function () { this.timeout(30 * 1000) - return ipfs('add src/init-files/init-docs/readme --cid-version=1') + return ipfs('add test/fixtures/less-than-default-max-chunk-size --cid-version=1') .then((out) => { expect(out) - .to.eql('added zdj7WWeQ43G6JJvLWQWZpyHuAMq6uYWRjkBXFad11vE2LHhQ7 readme\n') + .to.eql('added zb2rhh5LdXumxQfNZCqV8pmcC56LX71ERgf2qCNQsmZnwYYx9 less-than-default-max-chunk-size\n') }) }) - it('add with cid-version=1 and raw-leaves=false', function () { + it('add with cid-version=1 > default max chunk size', function () { this.timeout(30 * 1000) - return ipfs('add src/init-files/init-docs/readme --cid-version=1 --raw-leaves=false') + return ipfs('add test/fixtures/greater-than-default-max-chunk-size --cid-version=1') .then((out) => { expect(out) - .to.eql('added zdj7WWeQ43G6JJvLWQWZpyHuAMq6uYWRjkBXFad11vE2LHhQ7 readme\n') + .to.eql('added zdj7WbyyZoWVifUHUe58SNS184PpN8qAuCP6HpAY91iA8CveT greater-than-default-max-chunk-size\n') }) }) - it('add with cid-version=1 and raw-leaves=true', function () { + it('add with cid-version=1 and raw-leaves=false < default max chunk size', function () { this.timeout(30 * 1000) - return ipfs('add src/init-files/init-docs/readme --cid-version=1 --raw-leaves=true') + return ipfs(`add test/fixtures/less-than-default-max-chunk-size --cid-version=1 --raw-leaves=false`) .then((out) => { expect(out) - .to.eql('added zdj7WiLc855B1KPRgV7Fh8ivjuAhePE1tuJafmxH5HmmSjqaD readme\n') + .to.eql('added zdj7WWPWpmpFkrWJBhUEZ4QkGumsFsEdkaaEGs7U4dzJraogp less-than-default-max-chunk-size\n') + }) + }) + + it('add with cid-version=1 and raw-leaves=false > default max chunk size', function () { + this.timeout(30 * 1000) + + return ipfs(`add test/fixtures/greater-than-default-max-chunk-size --cid-version=1 --raw-leaves=false`) + .then((out) => { + expect(out) + .to.eql('added zdj7WmYojH6vMkDQFNDNwUy2ZawrggqAhS6jjRJwb1C4KXZni greater-than-default-max-chunk-size\n') + }) + }) + + it('add with cid-version=1 and raw-leaves=true < default max chunk size', function () { + this.timeout(30 * 1000) + + return ipfs('add test/fixtures/less-than-default-max-chunk-size --cid-version=1 --raw-leaves=true') + .then((out) => { + expect(out) + .to.eql('added zb2rhh5LdXumxQfNZCqV8pmcC56LX71ERgf2qCNQsmZnwYYx9 less-than-default-max-chunk-size\n') + }) + }) + + it('add with cid-version=1 and raw-leaves=true > default max chunk size', function () { + this.timeout(30 * 1000) + + return ipfs('add test/fixtures/greater-than-default-max-chunk-size --cid-version=1 --raw-leaves=true') + .then((out) => { + expect(out) + .to.eql('added zdj7WbyyZoWVifUHUe58SNS184PpN8qAuCP6HpAY91iA8CveT greater-than-default-max-chunk-size\n') }) }) diff --git a/test/fixtures/greater-than-default-max-chunk-size b/test/fixtures/greater-than-default-max-chunk-size new file mode 100644 index 0000000000..27347e687b Binary files /dev/null and b/test/fixtures/greater-than-default-max-chunk-size differ diff --git a/test/fixtures/less-than-default-max-chunk-size b/test/fixtures/less-than-default-max-chunk-size new file mode 100644 index 0000000000..ea6bec3f5f Binary files /dev/null and b/test/fixtures/less-than-default-max-chunk-size differ