From adeeaff828e44f6696f92b9248e5ea06dfd97346 Mon Sep 17 00:00:00 2001 From: greenkeeperio-bot Date: Mon, 6 Jun 2016 13:13:27 +0200 Subject: [PATCH 1/2] chore(package): update ipfs-bitswap to version 0.4.1 https://greenkeeper.io/ --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index be0a929bf2..a9be117265 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "glob": "^7.0.3", "hapi": "^13.4.1", "ipfs-api": "^4.1.0", - "ipfs-bitswap": "^0.4.0", + "ipfs-bitswap": "^0.4.1", "ipfs-block": "^0.3.0", "ipfs-block-service": "^0.4.0", "ipfs-merkle-dag": "^0.6.0", From 7850dbb4056318b44e25d3c10fc0121d5526c577 Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Mon, 6 Jun 2016 16:10:47 +0200 Subject: [PATCH 2/2] fix: handle new wantlist format --- src/cli/commands/bitswap/wantlist.js | 1 - src/core/ipfs/bitswap.js | 6 +----- test/cli/test-bitswap.js | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/cli/commands/bitswap/wantlist.js b/src/cli/commands/bitswap/wantlist.js index daebad04e0..bd258ff545 100644 --- a/src/cli/commands/bitswap/wantlist.js +++ b/src/cli/commands/bitswap/wantlist.js @@ -19,7 +19,6 @@ module.exports = Command.extend({ if (err) { throw err } - res.Keys.forEach((k) => console.log(k)) }) }) diff --git a/src/core/ipfs/bitswap.js b/src/core/ipfs/bitswap.js index ada2ecb29e..c8b7e1a806 100644 --- a/src/core/ipfs/bitswap.js +++ b/src/core/ipfs/bitswap.js @@ -1,13 +1,9 @@ 'use strict' -const bs58 = require('bs58') - const OFFLINE_ERROR = require('../utils').OFFLINE_ERROR function formatWantlist (list) { - return Array.from(list).map((el) => { - return bs58.encode(new Buffer(el[0], 'hex')) - }) + return Array.from(list).map((e) => e[0]) } module.exports = function bitswap (self) { diff --git a/test/cli/test-bitswap.js b/test/cli/test-bitswap.js index ee59f63a90..e58e7383f0 100644 --- a/test/cli/test-bitswap.js +++ b/test/cli/test-bitswap.js @@ -52,7 +52,7 @@ describe('bitswap', function () { nexpect.spawn('node', [process.cwd() + '/src/cli/bin.js', 'bitswap', 'wantlist'], {env}) .run((err, stdout, exitcode) => { expect(err).to.not.exist - // expect(exitcode).to.equal(0) + expect(exitcode).to.equal(0) expect(stdout).to.be.eql([ key ])