This repository was archived by the owner on Mar 10, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -48,11 +48,11 @@ A great source of [examples][] can be found in the tests for this API.
4848
4949> List all the objects pinned to local storage or under a specific hash.
5050
51- ##### ` ipfs.pin.ls([hash ], [options]) `
51+ ##### ` ipfs.pin.ls([cid ], [options]) `
5252
5353Where:
5454
55- - ` hash ` is an IPFS multihash .
55+ - ` cid ` - a [ CID ] [ cid ] instance or CID as a string or an array of CIDs .
5656- ` options ` is an object that can contain the following keys:
5757 - 'type' - Return also the type of pin (direct, indirect or recursive)
5858
@@ -107,3 +107,4 @@ console.log(pinset)
107107A great source of [ examples] [ ] can be found in the tests for this API.
108108
109109[ examples ] : https://github.com/ipfs/interface-ipfs-core/blob/master/src/pin
110+ [ cid ] : https://www.npmjs.com/package/cids
Original file line number Diff line number Diff line change @@ -140,5 +140,12 @@ module.exports = (createCommon, options) => {
140140 hash : fixtures . files [ 0 ] . cid
141141 } ] )
142142 } )
143+
144+ it ( 'should list pins for multiple CIDs' , async ( ) => {
145+ const pinset = await ipfs . pin . ls ( [ fixtures . files [ 0 ] . cid , fixtures . files [ 1 ] . cid ] )
146+ const cids = pinset . map ( ( { hash } ) => hash )
147+ expect ( cids ) . to . include ( fixtures . files [ 0 ] . cid )
148+ expect ( cids ) . to . include ( fixtures . files [ 1 ] . cid )
149+ } )
143150 } )
144151}
You can’t perform that action at this time.
0 commit comments