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

Commit b65cb6b

Browse files
authored
Merge pull request #72 from ipfs/fix/files.cat
refactor(files): call cat from files.cat like the interface defines it
2 parents 88d6002 + 9f3bfff commit b65cb6b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/files.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ module.exports = (common) => {
208208
describe('.cat', () => {
209209
it('with a base58 string encoded multihash', (done) => {
210210
const hash = 'Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP'
211-
ipfs.cat(hash, (err, stream) => {
211+
ipfs.files.cat(hash, (err, stream) => {
212212
expect(err).to.not.exist
213213
stream.pipe(bl((err, data) => {
214214
expect(err).to.not.exist
@@ -220,7 +220,7 @@ module.exports = (common) => {
220220

221221
it('with a multihash', (done) => {
222222
const mhBuf = new Buffer(bs58.decode('Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP'))
223-
ipfs.cat(mhBuf, (err, stream) => {
223+
ipfs.files.cat(mhBuf, (err, stream) => {
224224
expect(err).to.not.exist
225225
stream.pipe(bl((err, data) => {
226226
expect(err).to.not.exist
@@ -232,7 +232,7 @@ module.exports = (common) => {
232232

233233
it('streams a large file', (done) => {
234234
const hash = 'Qme79tX2bViL26vNjPsF3DP1R9rMKMvnPYJiKTTKPrXJjq'
235-
ipfs.cat(hash, (err, stream) => {
235+
ipfs.files.cat(hash, (err, stream) => {
236236
expect(err).to.not.exist
237237
stream.pipe(bl((err, data) => {
238238
expect(err).to.not.exist
@@ -262,7 +262,7 @@ module.exports = (common) => {
262262
it('with a base58 multihash encoded string', () => {
263263
const hash = 'Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP'
264264

265-
return ipfs.cat(hash)
265+
return ipfs.files.cat(hash)
266266
.then((stream) => {
267267
stream.pipe(bl((err, data) => {
268268
expect(err).to.not.exist
@@ -274,7 +274,7 @@ module.exports = (common) => {
274274
it('errors on invalid key', () => {
275275
const hash = 'somethingNotMultihash'
276276

277-
return ipfs.cat(hash)
277+
return ipfs.files.cat(hash)
278278
.catch((err) => {
279279
expect(err).to.exist
280280
const errString = err.toString()
@@ -289,7 +289,7 @@ module.exports = (common) => {
289289

290290
it('with a multihash', () => {
291291
const hash = new Buffer(bs58.decode('Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP'))
292-
return ipfs.cat(hash)
292+
return ipfs.files.cat(hash)
293293
.then((stream) => {
294294
stream.pipe(bl((err, data) => {
295295
expect(err).to.not.exist

0 commit comments

Comments
 (0)