chore: apply suggestions from code review

This commit is contained in:
Vasco Santos
2020-07-17 14:00:59 +02:00
committed by Jacob Heun
parent 15613ccf19
commit f574e82a5d
15 changed files with 75 additions and 68 deletions

View File

@ -55,7 +55,7 @@ describe('Dialing (direct, TCP)', () => {
})
remoteTM.add(Transport.prototype[Symbol.toStringTag], Transport)
peerStore = new PeerStore()
peerStore = new PeerStore({ peerId: remotePeerId })
localTM = new TransportManager({
libp2p: {},
upgrader: mockUpgrader
@ -106,13 +106,13 @@ describe('Dialing (direct, TCP)', () => {
})
it('should be able to connect to a given peer id', async () => {
const peerStore = new PeerStore()
const peerId = await PeerId.createFromJSON(Peers[0])
const peerStore = new PeerStore({ peerId })
const dialer = new Dialer({
transportManager: localTM,
peerStore
})
const peerId = await PeerId.createFromJSON(Peers[0])
peerStore.addressBook.set(peerId, [remoteAddr])
const connection = await dialer.connectToPeer(peerId)