File tree 3 files changed +3
-7
lines changed
3 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -182,7 +182,6 @@ class ConnectionManager extends EventEmitter {
182
182
this . emit ( 'peer:connect' , connection )
183
183
}
184
184
185
- this . _libp2p . peerStore . addressBook . add ( peerId , [ connection . remoteAddr ] )
186
185
this . _libp2p . peerStore . keyBook . set ( peerId , peerId . pubKey )
187
186
188
187
if ( ! this . _peerValues . has ( peerIdStr ) ) {
Original file line number Diff line number Diff line change @@ -242,8 +242,8 @@ describe('Identify', () => {
242
242
expect ( connection ) . to . exist ( )
243
243
244
244
// Wait for peer store to be updated
245
- // Dialer._createDialTarget (add), Connected (add), Identify (replace)
246
- await pWaitFor ( ( ) => peerStoreSpySet . callCount === 1 && peerStoreSpyAdd . callCount === 2 )
245
+ // Dialer._createDialTarget (add), Identify (replace)
246
+ await pWaitFor ( ( ) => peerStoreSpySet . callCount === 1 && peerStoreSpyAdd . callCount === 1 )
247
247
expect ( libp2p . identifyService . identify . callCount ) . to . equal ( 1 )
248
248
249
249
// The connection should have no open streams
Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ describe('libp2p.peerStore', () => {
24
24
} )
25
25
26
26
it ( 'adds peer address to AddressBook and keys to the keybook when establishing connection' , async ( ) => {
27
- const idStr = libp2p . peerId . toB58String ( )
28
27
const remoteIdStr = remoteLibp2p . peerId . toB58String ( )
29
28
30
29
const spyAddressBook = sinon . spy ( libp2p . peerStore . addressBook , 'add' )
@@ -44,9 +43,7 @@ describe('libp2p.peerStore', () => {
44
43
// const publicKeyInLocalPeer = localPeers.get(remoteIdStr).id.pubKey
45
44
// expect(publicKeyInLocalPeer.bytes).to.equalBytes(remoteLibp2p.peerId.pubKey.bytes)
46
45
47
- const remotePeers = remoteLibp2p . peerStore . peers
48
- expect ( remotePeers . size ) . to . equal ( 1 )
49
- const publicKeyInRemotePeer = remotePeers . get ( idStr ) . id . pubKey
46
+ const publicKeyInRemotePeer = remoteLibp2p . peerStore . keyBook . get ( libp2p . peerId )
50
47
expect ( publicKeyInRemotePeer ) . to . exist ( )
51
48
expect ( publicKeyInRemotePeer . bytes ) . to . equalBytes ( libp2p . peerId . pubKey . bytes )
52
49
} )
You can’t perform that action at this time.
0 commit comments