Fix double whisper types export by moving to separate file

This commit is contained in:
kdeme 2019-12-10 12:18:52 +01:00
parent 5bd7baaf9c
commit 59ba63f74c
No known key found for this signature in database
GPG Key ID: 4E8DD21420AF43F5
3 changed files with 20 additions and 7 deletions

View File

@ -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

View File

@ -38,8 +38,6 @@ import
options, tables, times, chronos, chronicles, options, tables, times, chronos, chronicles,
eth/[keys, async_utils, p2p], whisper/whisper_types eth/[keys, async_utils, p2p], whisper/whisper_types
import eth/p2p/rlpx_protocols/whisper_protocol
export export
whisper_types whisper_types
@ -465,5 +463,3 @@ proc resetMessageQueue*(node: EthereumNode) =
## NOTE: Not something that should be run in normal circumstances. ## NOTE: Not something that should be run in normal circumstances.
node.protocolState(Waku).queue[] = initQueue(defaultQueueCapacity) node.protocolState(Waku).queue[] = initQueue(defaultQueueCapacity)
proc shareMessageQueue*(node: EthereumNode) =
node.protocolState(Waku).queue = node.protocolState(Whisper).queue

View File

@ -9,11 +9,11 @@
import import
sequtils, unittest, tables, chronos, eth/p2p, eth/p2p/peer_pool, 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 ./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 safeTTL = 5'u32
let waitInterval = waku.messageInterval + 150.milliseconds let waitInterval = waku.messageInterval + 150.milliseconds