Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Commit

Permalink
fix: allow passing timeout option to object stat (#1055)
Browse files Browse the repository at this point in the history
The ipfs object stat command couldn't handle the {timeout: '1s'} option (or any other options). We're already checking for the opts parameter so it makes sense that we should be sending it as well. 

Things work as desired now with this one line addition.
  • Loading branch information
obo20 authored and Alan Shaw committed Jul 26, 2019
1 parent 42626d8 commit 92b0594
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"cross-env": "^5.2.0",
"dirty-chai": "^2.0.1",
"go-ipfs-dep": "~0.4.21",
"interface-ipfs-core": "^0.107.1",
"interface-ipfs-core": "^0.109.0",
"ipfsd-ctl": "~0.43.0",
"nock": "^10.0.2",
"stream-equal": "^1.1.1"
Expand Down
3 changes: 2 additions & 1 deletion src/object/stat.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ module.exports = (send) => {

send({
path: 'object/stat',
args: cid.toString()
args: cid.toString(),
qs: opts
}, callback)
})
}
14 changes: 13 additions & 1 deletion test/interface.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ describe('interface-ipfs-core tests', () => {
{
name: 'replace',
reason: 'FIXME Waiting for fix on go-ipfs https://github.com/ipfs/js-ipfs-http-client/pull/307#discussion_r69281789 and https://github.com/ipfs/go-ipfs/issues/2927'
},
// config.profile
{
name: 'profile',
reason: 'TODO not yet implemented https://github.com/ipfs/js-ipfs-http-client/pull/1030'
}
]
})
Expand Down Expand Up @@ -182,7 +187,14 @@ describe('interface-ipfs-core tests', () => {
]
})

tests.filesMFS(defaultCommonFactory)
tests.filesMFS(defaultCommonFactory, {
skip: [
{
name: 'should ls directory with long option',
reason: 'TODO unskip when go-ipfs supports --long https://github.com/ipfs/go-ipfs/pull/6528'
}
]
})

tests.key(defaultCommonFactory, {
skip: [
Expand Down

0 comments on commit 92b0594

Please sign in to comment.