-
Notifications
You must be signed in to change notification settings - Fork 0
Only hash option #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This PR adds the code to skip the step where files are written to disk if you pass in the --only-hash flag over an http request
test/files.spec.js
Outdated
const FactoryClient = require('./ipfs-factory/client') | ||
|
||
const testfile = isNode | ||
? loadFixture(__dirname, '/fixtures/testfile.txt') | ||
: loadFixture(__dirname, 'fixtures/testfile.txt') | ||
|
||
// TODO: Test against all algorithms Object.keys(mh.names) | ||
// This subset is known to work with both go-ipfs and js-ipfs as of 2017-09-05 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please reinstate these above const HASH_ALGS = [
test/files.spec.js
Outdated
const message = `Failed to get block for ${hash}: context canceled` | ||
expect(err.message.indexOf(message)).to.be.above(-1) | ||
}) | ||
done() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not done until after you attempt to fetch the file
test/files.spec.js
Outdated
|
||
const hash = collected[0].Hash | ||
|
||
ipfs.files.get(hash, (err, res) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use ipfs refs local
for this.
Rather than use ipfs.get to search for a hash (which should not be there anyway) just use ipfs.refs.local to verify that the hash has not been added to ipfs
Adds promise based tests and uses same method to verify test behaviour
262 tests passing (2m) |
This PR adds support for the
--only-hash
option when using the HTTP client