mirror of https://github.com/waku-org/nwaku.git
refactor: remove unnecessary peermanager dependency (#1474)
This commit is contained in:
parent
76bb7520f3
commit
53bf00de69
|
@ -382,7 +382,7 @@ proc mountRelay*(node: WakuNode,
|
|||
info "mounting relay protocol"
|
||||
|
||||
let initRes = WakuRelay.new(
|
||||
node.peerManager,
|
||||
node.switch,
|
||||
defaultPubsubTopics = concat(@[DefaultPubsubTopic], topics),
|
||||
triggerSelf = triggerSelf
|
||||
)
|
||||
|
|
|
@ -16,9 +16,9 @@ import
|
|||
libp2p/protocols/pubsub/pubsub,
|
||||
libp2p/protocols/pubsub/rpc/messages,
|
||||
libp2p/protocols/pubsub/gossipsub,
|
||||
libp2p/stream/connection
|
||||
libp2p/stream/connection,
|
||||
libp2p/switch
|
||||
import
|
||||
../node/peer_manager/peer_manager,
|
||||
./waku_message
|
||||
|
||||
logScope:
|
||||
|
@ -36,7 +36,6 @@ type
|
|||
|
||||
type
|
||||
WakuRelay* = ref object of GossipSub
|
||||
peerManager: PeerManager
|
||||
defaultPubsubTopics*: seq[PubsubTopic] # Default configured PubSub topics
|
||||
|
||||
|
||||
|
@ -77,7 +76,7 @@ method initPubSub(w: WakuRelay) {.raises: [InitializationError].} =
|
|||
|
||||
|
||||
proc new*(T: type WakuRelay,
|
||||
peerManager: PeerManager,
|
||||
switch: Switch,
|
||||
defaultPubsubTopics: seq[PubsubTopic] = @[],
|
||||
triggerSelf: bool = true): WakuRelayResult[T] =
|
||||
|
||||
|
@ -91,7 +90,7 @@ proc new*(T: type WakuRelay,
|
|||
var wr: WakuRelay
|
||||
try:
|
||||
wr = WakuRelay.init(
|
||||
switch = peerManager.switch,
|
||||
switch = switch,
|
||||
msgIdProvider = msgIdProvider,
|
||||
triggerSelf = triggerSelf,
|
||||
sign = false,
|
||||
|
@ -101,7 +100,6 @@ proc new*(T: type WakuRelay,
|
|||
except InitializationError:
|
||||
return err("initialization error: " & getCurrentExceptionMsg())
|
||||
|
||||
wr.peerManager = peerManager
|
||||
wr.defaultPubsubTopics = defaultPubsubTopics
|
||||
|
||||
ok(wr)
|
||||
|
|
Loading…
Reference in New Issue