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

feat: allow passing the id of a network peer to ipfs.id #3386

Merged
merged 7 commits into from
May 13, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: fix more tests
  • Loading branch information
achingbrain committed May 13, 2021
commit ecff36c43ac03cb7274961e27968bce8d9cbd23d
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/miscellaneous/id.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ module.exports = (common, options) => {
})

expect(result).to.deep.equal(ipfsB.peerId)
}, {retries: 5})
}, { retries: 5 })
})

it('should get our own id when passed as an option', async function () {
Expand Down
3 changes: 2 additions & 1 deletion packages/ipfs-cli/test/id.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const sinon = require('sinon')
const PeerId = require('peer-id')

const defaultOptions = {
timeout: undefined
timeout: undefined,
peerId: undefined
}

describe('id', () => {
Expand Down
5 changes: 2 additions & 3 deletions packages/ipfs-http-server/test/inject/id.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const testHttpMethod = require('../utils/test-http-method')
const http = require('../utils/http')
const sinon = require('sinon')
const { AbortSignal } = require('native-abort-controller')
const PeerId = require('peer-id')

const defaultOptions = {
signal: sinon.match.instanceOf(AbortSignal),
Expand Down Expand Up @@ -69,11 +68,11 @@ describe('/id', () => {
})

it('get the id of another peer', async () => {
const peerId = PeerId.createFromB58String('QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D')
const peerId = 'QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D'

ipfs.id.withArgs({
...defaultOptions,
peerId: peerId.toString()
peerId
}).returns({
id: 'id',
publicKey: 'publicKey',
Expand Down