Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Commit

Permalink
chore: apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-Authored-By: Jacob Heun <jacobheun@gmail.com>
  • Loading branch information
vasco-santos and jacobheun committed Nov 19, 2019
1 parent aa29260 commit ba96e12
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/content-routing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ module.exports = (dht) => {
* @param {number} options.maxNumProviders - maximum number of providers to find
* @returns {Promise<PeerInfo>}
*/
async findProviders (key, options = {}) { // eslint-disable-line require-await
async findProviders (key, options = {}) {
const providerTimeout = options.timeout || c.minute
const n = options.maxNumProviders || c.K

Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ class KadDHT extends EventEmitter {
* the message.
*
* @param {Message} msg
* @returns {Promose<Array<PeerInfo>>}
* @returns {Promise<Array<PeerInfo>>}
* @private
*/
async _nearestPeersToQuery (msg) {
Expand Down Expand Up @@ -459,7 +459,7 @@ class KadDHT extends EventEmitter {
*
* @param {PeerId} peer
* @param {Buffer} key
* @returns {Promise<{Record, Array<PeerInfo}>} // TODO: define obj
* @returns {Promise<{Record, Array<PeerInfo}>}
* @private
*/

Expand Down
7 changes: 0 additions & 7 deletions test/kad-dht.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@ describe('KadDHT', () => {
const tdht = new TestDHT()
const dhts = await tdht.spawn(4)

// const addrs = dhts.map((d) => d.peerInfo.multiaddrs.toArray()[0])
const ids = dhts.map((d) => d.peerInfo.id)
const idsB58 = ids.map(id => id.toB58String())
sinon.spy(dhts[3].network, 'sendMessage')
Expand Down Expand Up @@ -448,12 +447,6 @@ describe('KadDHT', () => {

expect(provs).to.have.length(1)
expect(provs[0].id.id).to.be.eql(ids[3].id)
// TODO: /ipfs => /p2p
// expect(
// provs[0].multiaddrs.toArray()[0].toString()
// ).to.equal(
// addrs[3].toString()
// )
})

return tdht.teardown()
Expand Down
2 changes: 0 additions & 2 deletions test/providers.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ describe('Providers', () => {

// slooow so only run when you need to
it.skip('many', async function () {
this.timeout(100 * 1000)

const p = path.join(
os.tmpdir(), (Math.random() * 100).toString()
)
Expand Down

0 comments on commit ba96e12

Please sign in to comment.