Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix: handle new wantlist format
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Jun 6, 2016
1 parent adeeaff commit 7850dbb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/cli/commands/bitswap/wantlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ module.exports = Command.extend({
if (err) {
throw err
}

res.Keys.forEach((k) => console.log(k))
})
})
Expand Down
6 changes: 1 addition & 5 deletions src/core/ipfs/bitswap.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion test/cli/test-bitswap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
])
Expand Down

0 comments on commit 7850dbb

Please sign in to comment.