mirror of
https://github.com/fluencelabs/js-libp2p-interfaces
synced 2025-03-31 07:41:25 +00:00
* fix: reconnect should trigger topology on connect if protocol stored * chore: address review
20 lines
317 B
JavaScript
20 lines
317 B
JavaScript
'use strict'
|
|
|
|
const { EventEmitter } = require('events')
|
|
|
|
class MockPeerStore extends EventEmitter {
|
|
constructor (peers) {
|
|
super()
|
|
this.peers = peers
|
|
this.protoBook = {
|
|
get: () => {}
|
|
}
|
|
}
|
|
|
|
get (peerId) {
|
|
return this.peers.get(peerId.toB58String())
|
|
}
|
|
}
|
|
|
|
module.exports = MockPeerStore
|