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

Commit

Permalink
fix: bitswap wantlist stats
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Dec 23, 2016
1 parent 58f0885 commit 9db86f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/cli/commands/bitswap/stat.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict'

const utils = require('../../utils')
const CID = require('cids')

module.exports = {
command: 'stat',
Expand All @@ -21,6 +22,11 @@ module.exports = {
}

stats.Wantlist = stats.Wantlist || []
stats.Wantlist = stats.Wantlist.map((entry) => {
const buf = new Buffer(entry.cid.hash.data)
const cid = new CID(entry.cid.version, entry.cid.codec, buf)
return cid.toBaseEncodedString()
})
stats.Peers = stats.Peers || []

console.log(`bitswap status
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 @@ -10,7 +10,7 @@ const createTempNode = require('../utils/temp-node')
const repoPath = require('./index').repoPath
const ipfs = require('../utils/ipfs-exec')(repoPath)

describe.only('bitswap', () => {
describe('bitswap', () => {
let node

before((done) => {
Expand Down

0 comments on commit 9db86f5

Please sign in to comment.