-
Notifications
You must be signed in to change notification settings - Fork 108
Conversation
Also need tests for ipfs.object.put(new Buffer('hello'), {enc: 'json'})
ipfs.object.put(new Buffer('hello'), {enc: 'yaml'}) |
03d519d
to
ec27a08
Compare
Not sure how this would work, if we say that the Buffer has json or yaml encoding, shouldn't it be complete? Passing it through the HTTP-API makes it fail, I've made a test for it: https://github.com/ipfs/interface-ipfs-core/pull/2/files#diff-eaac2b5121380ed7f166ff7fe9e32c5bR108 The test that I have and that works as expect is: https://github.com/ipfs/interface-ipfs-core/pull/2/files#diff-eaac2b5121380ed7f166ff7fe9e32c5bR45 |
a2954b8
to
d06008f
Compare
it.skip('object.put of buffer and enc json', (done) => { | ||
const buf = new Buffer('Some data') | ||
|
||
ipfs.object.put(buf, { enc: 'json' }, (err, node) => { |
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.
Sorry, I meant sth like this:
const buf = new Buffer(JSON.stringify({Data: 'hello world', Links: ['some link']}))
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.
and also the same with a yaml version
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.
Ok, the first one is already there, just missing the yaml one then
1af3f0c
to
6306abd
Compare
it('object.stat with multihash base58 encoded toString', (done) => { | ||
const testObj = { | ||
Data: new Buffer('get test object'), | ||
Links: [] |
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.
Need a test with links, to ensure the returned stats are correct
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.
good point! thank you :)
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.
added
6306abd
to
7d97903
Compare
7d97903
to
478c03c
Compare
tests complete and also js-ipfs-api is compatible with all this tests now :) |
Merging as this code got several reviews by @dignifiedquire :) |
it('object.data', (done) => { | ||
ipfs.object.data(testObjectHash, (err, res) => { | ||
// TODO verify that yaml encoded buffers still work in go-ipfs | ||
it.skip('object.put of yaml encoded buffer', (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.
@diasdavid yaml was never available, json and protobuf are the supported encodings according to the help section
Data should be in the format specified by the --inputenc flag.
--inputenc may be one of the following:
* "protobuf"
* "json" (default)
WIP.. this is going to be big