diff --git a/eth/p2p/rlpx_protocols/waku_bridge.nim b/eth/p2p/rlpx_protocols/waku_bridge.nim new file mode 100644 index 0000000..a5cbc7f --- /dev/null +++ b/eth/p2p/rlpx_protocols/waku_bridge.nim @@ -0,0 +1,17 @@ +# +# Waku - Whisper Bridge +# (c) Copyright 2019 +# Status Research & Development GmbH +# +# Licensed under either of +# Apache License, version 2.0, (LICENSE-APACHEv2) +# MIT license (LICENSE-MIT) +# + +import + eth/p2p, + eth/p2p/rlpx_protocols/waku_protocol, + eth/p2p/rlpx_protocols/whisper_protocol + +proc shareMessageQueue*(node: EthereumNode) = + node.protocolState(Waku).queue = node.protocolState(Whisper).queue diff --git a/eth/p2p/rlpx_protocols/waku_protocol.nim b/eth/p2p/rlpx_protocols/waku_protocol.nim index b8630be..d180f24 100644 --- a/eth/p2p/rlpx_protocols/waku_protocol.nim +++ b/eth/p2p/rlpx_protocols/waku_protocol.nim @@ -38,8 +38,6 @@ import options, tables, times, chronos, chronicles, eth/[keys, async_utils, p2p], whisper/whisper_types -import eth/p2p/rlpx_protocols/whisper_protocol - export whisper_types @@ -465,5 +463,3 @@ proc resetMessageQueue*(node: EthereumNode) = ## NOTE: Not something that should be run in normal circumstances. node.protocolState(Waku).queue[] = initQueue(defaultQueueCapacity) -proc shareMessageQueue*(node: EthereumNode) = - node.protocolState(Waku).queue = node.protocolState(Whisper).queue diff --git a/tests/p2p/test_waku_bridge.nim b/tests/p2p/test_waku_bridge.nim index ed548ae..44ffc06 100644 --- a/tests/p2p/test_waku_bridge.nim +++ b/tests/p2p/test_waku_bridge.nim @@ -9,11 +9,11 @@ import sequtils, unittest, tables, chronos, eth/p2p, eth/p2p/peer_pool, + eth/p2p/rlpx_protocols/waku_bridge, + eth/p2p/rlpx_protocols/waku_protocol as waku, + eth/p2p/rlpx_protocols/whisper_protocol as whisper, ./p2p_test_helper -import eth/p2p/rlpx_protocols/waku_protocol as waku -import eth/p2p/rlpx_protocols/whisper_protocol as whisper - let safeTTL = 5'u32 let waitInterval = waku.messageInterval + 150.milliseconds