diff --git a/packages/ipfs-unixfs-importer/src/index.js b/packages/ipfs-unixfs-importer/src/index.js index a6b1f2da..2559ffb3 100644 --- a/packages/ipfs-unixfs-importer/src/index.js +++ b/packages/ipfs-unixfs-importer/src/index.js @@ -36,28 +36,6 @@ const defaultOptions = { module.exports = async function * (source, block, options = {}) { const opts = mergeOptions(defaultOptions, options) - if (options.cidVersion > 0 && options.rawLeaves === undefined) { - // if the cid version is 1 or above, use raw leaves as this is - // what go does. - opts.rawLeaves = true - } - - if (options.hashAlg !== undefined && options.rawLeaves === undefined) { - // if a non-default hash alg has been specified, use raw leaves as this is - // what go does. - opts.rawLeaves = true - } - - // go-ifps trickle dag defaults to unixfs raw leaves, balanced dag defaults to file leaves - if (options.strategy === 'trickle') { - opts.leafType = 'raw' - opts.reduceSingleLeafToSelf = false - } - - if (options.format) { - opts.codec = options.format - } - let dagBuilder if (typeof options.dagBuilder === 'function') { diff --git a/packages/ipfs-unixfs-importer/test/hash-parity-with-go-ipfs.spec.js b/packages/ipfs-unixfs-importer/test/hash-parity-with-go-ipfs.spec.js index 6f46d67b..ae2279d3 100644 --- a/packages/ipfs-unixfs-importer/test/hash-parity-with-go-ipfs.spec.js +++ b/packages/ipfs-unixfs-importer/test/hash-parity-with-go-ipfs.spec.js @@ -27,6 +27,12 @@ strategies.forEach(strategy => { strategy: strategy } + if (strategy === 'trickle') { + // replicate go-ipfs behaviour + options.leafType = 'raw' + options.reduceSingleLeafToSelf = false + } + describe('go-ipfs interop using importer:' + strategy, () => { let ipld let block diff --git a/packages/ipfs-unixfs-importer/test/importer.spec.js b/packages/ipfs-unixfs-importer/test/importer.spec.js index fa95e76a..37e5399a 100644 --- a/packages/ipfs-unixfs-importer/test/importer.spec.js +++ b/packages/ipfs-unixfs-importer/test/importer.spec.js @@ -319,6 +319,12 @@ strategies.forEach((strategy) => { strategy: strategy } + if (strategy === 'trickle') { + // replicate go-ipfs behaviour + options.leafType = 'raw' + options.reduceSingleLeafToSelf = false + } + before(async () => { ipld = await inMemory(IPLD) block = blockApi(ipld)