From eb6dbb3d1e9e6e0b3a678198b43cfbfe6656e4e3 Mon Sep 17 00:00:00 2001 From: Lorenzo Delgado Date: Fri, 4 Nov 2022 10:52:08 +0100 Subject: [PATCH] chore: remove unused imports --- apps/chat2/chat2.nim | 6 ++--- apps/chat2bridge/chat2bridge.nim | 2 +- apps/wakunode2/wakunode2.nim | 13 +++++----- tests/v1/test_rpc_waku.nim | 2 +- tests/v2/test_message_store_queue.nim | 2 +- .../test_message_store_queue_pagination.nim | 2 +- tests/v2/test_peer_exchange.nim | 1 - tests/v2/test_peer_manager.nim | 6 ++--- tests/v2/test_peer_storage.nim | 3 ++- tests/v2/test_rest_debug_api.nim | 1 - tests/v2/test_rest_debug_api_serdes.nim | 8 +++--- tests/v2/test_rest_relay_api.nim | 1 - tests/v2/test_waku_bridge.nim | 4 ++- tests/v2/test_waku_discv5.nim | 5 ++-- tests/v2/test_waku_filter.nim | 3 +-- tests/v2/test_waku_keepalive.nim | 17 ++++++++----- tests/v2/test_waku_lightpush.nim | 2 -- tests/v2/test_waku_noise_sessions.nim | 13 ++++------ tests/v2/test_waku_peer_exchange.nim | 4 +-- tests/v2/test_waku_rln_relay.nim | 25 +++++++++++-------- tests/v2/test_waku_store.nim | 4 +-- tests/v2/test_waku_store_client.nim | 4 +-- tests/v2/test_waku_store_rpc_codec.nim | 7 ++---- tests/v2/test_waku_swap.nim | 4 +-- tests/v2/test_wakunode.nim | 15 +++++++---- tests/v2/test_wakunode_filter.nim | 3 --- tests/v2/test_wakunode_lightpush.nim | 2 -- tests/v2/test_wakunode_rln_relay.nim | 18 ++++++------- tests/v2/test_wakunode_store.nim | 1 - tests/whisper/test_shh_config.nim | 2 +- waku/v1/node/rpc/hexstrings.nim | 2 +- waku/v1/node/rpc/rpc_types.nim | 2 +- waku/v1/node/rpc/waku.nim | 2 +- waku/v1/node/wakunode1.nim | 4 +-- waku/v2/node/jsonrpc/admin_api.nim | 2 +- waku/v2/node/rest/debug/debug_api.nim | 1 - waku/v2/node/rest/serdes.nim | 5 +++- waku/v2/node/waku_metrics.nim | 4 +-- waku/v2/node/waku_node.nim | 18 +++++++------ waku/v2/protocol/waku_noise/noise.nim | 8 +++--- .../waku_noise/noise_handshake_processing.nim | 6 ++--- waku/v2/protocol/waku_noise/noise_types.nim | 5 ++-- waku/v2/protocol/waku_noise/noise_utils.nim | 3 +-- .../protocol/waku_peer_exchange/protocol.nim | 1 - .../waku_rln_relay/waku_rln_relay_types.nim | 12 +++++---- waku/v2/protocol/waku_store/rpc.nim | 4 +-- 46 files changed, 123 insertions(+), 136 deletions(-) diff --git a/apps/chat2/chat2.nim b/apps/chat2/chat2.nim index fc4e27ca1..612422171 100644 --- a/apps/chat2/chat2.nim +++ b/apps/chat2/chat2.nim @@ -8,7 +8,7 @@ when not(compileOption("threads")): import std/[tables, strformat, strutils, times, json, options, random] import confutils, chronicles, chronos, stew/shims/net as stewNet, - eth/keys, bearssl, stew/[byteutils, endians2, results], + eth/keys, bearssl, stew/[byteutils, results], nimcrypto/pbkdf2 import libp2p/[switch, # manage transports, a single entry point for dialing and listening crypto/crypto, # cryptographic functions @@ -17,10 +17,8 @@ import libp2p/[switch, # manage transports, a single entry poi peerinfo, # manage the information of a peer, such as peer ID and public / private key peerid, # Implement how peers interact protobuf/minprotobuf, # message serialisation/deserialisation from and to protobufs - protocols/protocol, # define the protocol base type protocols/secure/secio, # define the protocol of secure input / output, allows encrypted communication that uses public keys to validate signed messages instead of a certificate authority like in TLS - nameresolving/dnsresolver,# define DNS resolution - muxers/muxer] # define an interface for stream multiplexing, allowing peers to offer many protocols over a single connection + nameresolving/dnsresolver]# define DNS resolution import ../../waku/v2/protocol/waku_message, ../../waku/v2/protocol/waku_lightpush, diff --git a/apps/chat2bridge/chat2bridge.nim b/apps/chat2bridge/chat2bridge.nim index 4c29a3ab7..c2206cf05 100644 --- a/apps/chat2bridge/chat2bridge.nim +++ b/apps/chat2bridge/chat2bridge.nim @@ -4,7 +4,7 @@ import std/[tables, times, strutils, hashes, sequtils], chronos, confutils, chronicles, chronicles/topics_registry, chronos/streams/tlsstream, metrics, metrics/chronos_httpserver, - stew/[byteutils, endians2], + stew/byteutils, stew/shims/net as stewNet, json_rpc/rpcserver, # Matterbridge client imports ../../waku/common/utils/matterbridge_client, diff --git a/apps/wakunode2/wakunode2.nim b/apps/wakunode2/wakunode2.nim index a92ac0791..b9389144c 100644 --- a/apps/wakunode2/wakunode2.nim +++ b/apps/wakunode2/wakunode2.nim @@ -9,18 +9,17 @@ import system/ansi_c, eth/keys, eth/p2p/discoveryv5/enr, - libp2p/[builders, multihash], + libp2p/builders, + libp2p/multihash, libp2p/crypto/crypto, libp2p/protocols/ping, - libp2p/protocols/pubsub/[gossipsub, rpc/messages], - libp2p/transports/[transport, wstransport], + libp2p/protocols/pubsub/gossipsub, + libp2p/protocols/pubsub/rpc/messages, + libp2p/transports/wstransport, libp2p/nameresolving/dnsresolver import ../../waku/common/sqlite, ../../waku/common/utils/nat, - ../../waku/v2/protocol/waku_store, - ../../waku/v2/protocol/waku_filter, - ../../waku/v2/protocol/waku_peer_exchange, ../../waku/v2/node/peer_manager/peer_manager, ../../waku/v2/node/peer_manager/peer_store/waku_peer_storage, ../../waku/v2/node/peer_manager/peer_store/migrations as peer_store_sqlite_migrations, @@ -35,6 +34,8 @@ import ../../waku/v2/node/wakuswitch, ../../waku/v2/node/waku_node, ../../waku/v2/node/waku_metrics, + ../../waku/v2/protocol/waku_store, + ../../waku/v2/protocol/waku_peer_exchange, ../../waku/v2/utils/peers, ../../waku/v2/utils/wakuenr, ./wakunode2_setup_rest, diff --git a/tests/v1/test_rpc_waku.nim b/tests/v1/test_rpc_waku.nim index b535adfb7..fbef0bea0 100644 --- a/tests/v1/test_rpc_waku.nim +++ b/tests/v1/test_rpc_waku.nim @@ -3,7 +3,7 @@ import std/[options, os, strutils], testutils/unittests, stew/byteutils, json_rpc/[rpcserver, rpcclient], - eth/common as eth_common, eth/[rlp, keys, p2p], + eth/common as eth_common, eth/[keys, p2p], ../../waku/v1/protocol/waku_protocol, ../../waku/v1/node/rpc/[hexstrings, rpc_types, waku, key_storage] diff --git a/tests/v2/test_message_store_queue.nim b/tests/v2/test_message_store_queue.nim index 201ed22f1..045f32c7d 100644 --- a/tests/v2/test_message_store_queue.nim +++ b/tests/v2/test_message_store_queue.nim @@ -1,7 +1,7 @@ {.used.} import - std/[sequtils, strutils, algorithm], + std/[sequtils, algorithm], stew/results, testutils/unittests import diff --git a/tests/v2/test_message_store_queue_pagination.nim b/tests/v2/test_message_store_queue_pagination.nim index c10561d79..73fe105b8 100644 --- a/tests/v2/test_message_store_queue_pagination.nim +++ b/tests/v2/test_message_store_queue_pagination.nim @@ -1,7 +1,7 @@ {.used.} import - std/[options, sequtils, algorithm], + std/[sequtils, algorithm], testutils/unittests, nimcrypto/sha2, libp2p/protobuf/minprotobuf diff --git a/tests/v2/test_peer_exchange.nim b/tests/v2/test_peer_exchange.nim index d2c24c407..8a6ef4bb5 100644 --- a/tests/v2/test_peer_exchange.nim +++ b/tests/v2/test_peer_exchange.nim @@ -4,7 +4,6 @@ import std/[sequtils, options], stew/shims/net, testutils/unittests, - chronicles, chronos, libp2p/peerid, libp2p/crypto/crypto, diff --git a/tests/v2/test_peer_manager.nim b/tests/v2/test_peer_manager.nim index 4630cb19d..2c7730c17 100644 --- a/tests/v2/test_peer_manager.nim +++ b/tests/v2/test_peer_manager.nim @@ -1,11 +1,11 @@ {.used.} import - std/[options, tables, sequtils], + std/[options, sequtils], stew/shims/net as stewNet, - chronicles, testutils/unittests, - json_rpc/[rpcserver, rpcclient], + json_rpc/rpcserver, + json_rpc/rpcclient, eth/keys, eth/common/eth_types, libp2p/[builders, switch, multiaddress], diff --git a/tests/v2/test_peer_storage.nim b/tests/v2/test_peer_storage.nim index 15d87e378..9dd71ff22 100644 --- a/tests/v2/test_peer_storage.nim +++ b/tests/v2/test_peer_storage.nim @@ -1,7 +1,7 @@ {.used.} import - std/[unittest, sets], + testutils/unittests, libp2p/crypto/crypto import ../../waku/common/sqlite, @@ -9,6 +9,7 @@ import ../../waku/v2/node/peer_manager/peer_store/waku_peer_storage, ../test_helpers + suite "Peer Storage": test "Store, replace and retrieve from persistent peer storage": diff --git a/tests/v2/test_rest_debug_api.nim b/tests/v2/test_rest_debug_api.nim index a671be122..451e69788 100644 --- a/tests/v2/test_rest_debug_api.nim +++ b/tests/v2/test_rest_debug_api.nim @@ -2,7 +2,6 @@ import stew/shims/net, - chronicles, testutils/unittests, presto, presto/client as presto_client, libp2p/peerinfo, diff --git a/tests/v2/test_rest_debug_api_serdes.nim b/tests/v2/test_rest_debug_api_serdes.nim index 44ba77e8b..ece336429 100644 --- a/tests/v2/test_rest_debug_api_serdes.nim +++ b/tests/v2/test_rest_debug_api_serdes.nim @@ -1,9 +1,9 @@ {.used.} -import std/typetraits -import chronicles, - unittest2, - stew/[results, byteutils], +import + stew/results, + stew/byteutils, + testutils/unittests, json_serialization import ../../waku/v2/node/rest/serdes, diff --git a/tests/v2/test_rest_relay_api.nim b/tests/v2/test_rest_relay_api.nim index 351a3372b..a0fbcbc34 100644 --- a/tests/v2/test_rest_relay_api.nim +++ b/tests/v2/test_rest_relay_api.nim @@ -4,7 +4,6 @@ import std/sequtils, stew/byteutils, stew/shims/net, - chronicles, testutils/unittests, presto, presto/client as presto_client, libp2p/crypto/crypto, diff --git a/tests/v2/test_waku_bridge.nim b/tests/v2/test_waku_bridge.nim index a8433deda..23898711b 100644 --- a/tests/v2/test_waku_bridge.nim +++ b/tests/v2/test_waku_bridge.nim @@ -2,8 +2,10 @@ import std/[sequtils, strutils, tables], + stew/byteutils, + stew/shims/net as stewNet, testutils/unittests, - chronicles, chronos, stew/shims/net as stewNet, stew/[byteutils, objects], + chronos, libp2p/crypto/crypto, libp2p/crypto/secp, libp2p/peerid, diff --git a/tests/v2/test_waku_discv5.nim b/tests/v2/test_waku_discv5.nim index 6916185ca..67d1451c0 100644 --- a/tests/v2/test_waku_discv5.nim +++ b/tests/v2/test_waku_discv5.nim @@ -1,15 +1,14 @@ {.used.} import - std/tables, - chronicles, chronos, testutils/unittests, stew/byteutils, stew/shims/net, libp2p/crypto/crypto, eth/keys, - eth/p2p/discoveryv5/enr, + eth/p2p/discoveryv5/enr +import ../../waku/v2/protocol/waku_message, ../../waku/v2/node/discv5/waku_discv5, ../../waku/v2/node/waku_node, diff --git a/tests/v2/test_waku_filter.nim b/tests/v2/test_waku_filter.nim index f1d8f1705..d7957493c 100644 --- a/tests/v2/test_waku_filter.nim +++ b/tests/v2/test_waku_filter.nim @@ -1,10 +1,9 @@ {.used.} import - std/[options, tables, sets], + std/[options, tables], testutils/unittests, chronos, - chronicles, libp2p/crypto/crypto import ../../waku/v2/node/peer_manager/peer_manager, diff --git a/tests/v2/test_waku_keepalive.nim b/tests/v2/test_waku_keepalive.nim index 681100e64..ceda2f593 100644 --- a/tests/v2/test_waku_keepalive.nim +++ b/tests/v2/test_waku_keepalive.nim @@ -1,18 +1,23 @@ {.used.} import - std/[options, tables, sets], - testutils/unittests, chronos, chronicles, + std/options, stew/shims/net as stewNet, + testutils/unittests, + chronos, + chronicles, libp2p/switch, libp2p/protobuf/minprotobuf, libp2p/protocols/ping, - libp2p/stream/[bufferstream, connection], - libp2p/crypto/crypto, - libp2p/multistream, + libp2p/stream/bufferstream, + libp2p/stream/connection, + libp2p/crypto/crypto +import ../../waku/v2/node/waku_node, ../../waku/v2/utils/peers, - ../test_helpers, ./utils + ../test_helpers, + ./utils + procSuite "Waku Keepalive": diff --git a/tests/v2/test_waku_lightpush.nim b/tests/v2/test_waku_lightpush.nim index 61f889b1d..874021202 100644 --- a/tests/v2/test_waku_lightpush.nim +++ b/tests/v2/test_waku_lightpush.nim @@ -1,9 +1,7 @@ {.used.} import - std/options, testutils/unittests, - chronicles, chronos, libp2p/crypto/crypto import diff --git a/tests/v2/test_waku_noise_sessions.nim b/tests/v2/test_waku_noise_sessions.nim index 6bfa47175..2aafff622 100644 --- a/tests/v2/test_waku_noise_sessions.nim +++ b/tests/v2/test_waku_noise_sessions.nim @@ -1,20 +1,17 @@ {.used.} import - testutils/unittests, - std/random, - std/strutils, - std/tables, + std/[random,tables], stew/byteutils, + testutils/unittests, + libp2p/protobuf/minprotobuf +import ../../waku/v2/node/waku_payload, ../../waku/v2/protocol/waku_noise/noise_types, ../../waku/v2/protocol/waku_noise/noise_utils, - ../../waku/v2/protocol/waku_noise/noise, ../../waku/v2/protocol/waku_noise/noise_handshake_processing, ../../waku/v2/protocol/waku_message, - libp2p/protobuf/minprotobuf, - ../test_helpers, - stew/endians2 + ../test_helpers procSuite "Waku Noise Sessions": diff --git a/tests/v2/test_waku_peer_exchange.nim b/tests/v2/test_waku_peer_exchange.nim index c2aa2aed7..575cc8612 100644 --- a/tests/v2/test_waku_peer_exchange.nim +++ b/tests/v2/test_waku_peer_exchange.nim @@ -1,14 +1,13 @@ {.used.} import - std/[options, tables, sets], + std/options, testutils/unittests, chronos, chronicles, stew/shims/net, libp2p/switch, libp2p/crypto/crypto, - libp2p/multistream, eth/keys, eth/p2p/discoveryv5/enr import @@ -16,7 +15,6 @@ import ../../waku/v2/node/peer_manager/peer_manager, ../../waku/v2/node/discv5/waku_discv5, ../../waku/v2/protocol/waku_peer_exchange, - ../../waku/v2/protocol/waku_relay, ../test_helpers, ./utils diff --git a/tests/v2/test_waku_rln_relay.nim b/tests/v2/test_waku_rln_relay.nim index 5edb536da..7ea27dfe6 100644 --- a/tests/v2/test_waku_rln_relay.nim +++ b/tests/v2/test_waku_rln_relay.nim @@ -2,19 +2,22 @@ {.used.} import - std/[options, os, sequtils, times, deques], - testutils/unittests, chronos, chronicles, stint, - stew/byteutils, stew/shims/net as stewNet, - libp2p/crypto/crypto, - json + std/[options, os, sequtils, times], + stew/byteutils, + stew/shims/net as stewNet, + testutils/unittests, + chronos, + chronicles, + stint, + libp2p/crypto/crypto import - ../../waku/v2/protocol/waku_message, - ../../waku/v2/protocol/waku_rln_relay/[rln, - waku_rln_relay_utils, - waku_rln_relay_types, - waku_rln_relay_constants, - waku_rln_relay_metrics], ../../waku/v2/node/waku_node, + ../../waku/v2/protocol/waku_message, + ../../waku/v2/protocol/waku_rln_relay/rln, + ../../waku/v2/protocol/waku_rln_relay/waku_rln_relay_utils, + ../../waku/v2/protocol/waku_rln_relay/waku_rln_relay_types, + ../../waku/v2/protocol/waku_rln_relay/waku_rln_relay_constants, + ../../waku/v2/protocol/waku_rln_relay/waku_rln_relay_metrics, ../test_helpers const RlnRelayPubsubTopic = "waku/2/rlnrelay/proto" diff --git a/tests/v2/test_waku_store.nim b/tests/v2/test_waku_store.nim index 33313c882..5a3e83530 100644 --- a/tests/v2/test_waku_store.nim +++ b/tests/v2/test_waku_store.nim @@ -1,11 +1,9 @@ {.used.} import - std/[options, tables, sets, sequtils], - stew/byteutils, + std/[options, sequtils], testutils/unittests, chronos, - chronicles, libp2p/crypto/crypto import ../../waku/common/sqlite, diff --git a/tests/v2/test_waku_store_client.nim b/tests/v2/test_waku_store_client.nim index 1bb53fd8a..aa04f986f 100644 --- a/tests/v2/test_waku_store_client.nim +++ b/tests/v2/test_waku_store_client.nim @@ -1,10 +1,9 @@ {.used.} import - std/[options, tables], + std/options, testutils/unittests, chronos, - chronicles, libp2p/crypto/crypto import ../../waku/common/sqlite, @@ -13,7 +12,6 @@ import ../../waku/v2/protocol/waku_message, ../../waku/v2/protocol/waku_store, ../../waku/v2/protocol/waku_store/client, - ../../waku/v2/protocol/waku_store/protocol_metrics, ./testlib/common, ./testlib/switch diff --git a/tests/v2/test_waku_store_rpc_codec.nim b/tests/v2/test_waku_store_rpc_codec.nim index a6e189ebb..9a0745a67 100644 --- a/tests/v2/test_waku_store_rpc_codec.nim +++ b/tests/v2/test_waku_store_rpc_codec.nim @@ -2,12 +2,9 @@ import std/[options, times], - stew/byteutils, - testutils/unittests, - chronos, - chronicles + testutils/unittests, + chronos import - ../../waku/v2/protocol/waku_message, ../../waku/v2/protocol/waku_store, ../../waku/v2/utils/time, ./testlib/common diff --git a/tests/v2/test_waku_swap.nim b/tests/v2/test_waku_swap.nim index 9055ac143..79e24b99d 100644 --- a/tests/v2/test_waku_swap.nim +++ b/tests/v2/test_waku_swap.nim @@ -1,8 +1,7 @@ {.used.} import - std/[options, tables, sets], - stew/byteutils, + std/tables, stew/shims/net as stewNet, testutils/unittests, chronos, @@ -14,7 +13,6 @@ import libp2p/switch, eth/keys import - ../../waku/v2/protocol/waku_message, ../../waku/v2/protocol/waku_store, ../../waku/v2/protocol/waku_swap/waku_swap, ../../waku/v2/node/storage/message/waku_store_queue, diff --git a/tests/v2/test_wakunode.nim b/tests/v2/test_wakunode.nim index 222de0a63..c928d06bc 100644 --- a/tests/v2/test_wakunode.nim +++ b/tests/v2/test_wakunode.nim @@ -1,8 +1,11 @@ {.used.} import + stew/byteutils, + stew/shims/net as stewNet, testutils/unittests, - chronicles, chronos, stew/shims/net as stewNet, stew/byteutils, std/os, + chronicles, + chronos, libp2p/crypto/crypto, libp2p/crypto/secp, libp2p/multiaddress, @@ -10,11 +13,13 @@ import libp2p/protocols/pubsub/rpc/messages, libp2p/protocols/pubsub/pubsub, libp2p/protocols/pubsub/gossipsub, - libp2p/nameresolving/mockresolver, - ../../waku/v2/protocol/[waku_relay, waku_message], + libp2p/nameresolving/mockresolver +import + ../../waku/v2/node/waku_node, ../../waku/v2/node/peer_manager/peer_manager, - ../../waku/v2/utils/peers, - ../../waku/v2/node/waku_node + ../../waku/v2/protocol/waku_message, + ../../waku/v2/protocol/waku_relay, + ../../waku/v2/utils/peers procSuite "WakuNode": diff --git a/tests/v2/test_wakunode_filter.nim b/tests/v2/test_wakunode_filter.nim index 08702e5f0..48fd9bcde 100644 --- a/tests/v2/test_wakunode_filter.nim +++ b/tests/v2/test_wakunode_filter.nim @@ -1,17 +1,14 @@ {.used.} import - stew/byteutils, stew/shims/net as stewNet, testutils/unittests, - chronicles, chronos, libp2p/crypto/crypto import ../../waku/v2/node/peer_manager/peer_manager, ../../waku/v2/node/waku_node, ../../waku/v2/protocol/waku_message, - ../../waku/v2/protocol/waku_filter, ../../waku/v2/utils/peers, ./testlib/common diff --git a/tests/v2/test_wakunode_lightpush.nim b/tests/v2/test_wakunode_lightpush.nim index fcd569813..e28596b1b 100644 --- a/tests/v2/test_wakunode_lightpush.nim +++ b/tests/v2/test_wakunode_lightpush.nim @@ -1,10 +1,8 @@ {.used.} import - stew/byteutils, stew/shims/net as stewNet, testutils/unittests, - chronicles, chronos, libp2p/crypto/crypto, libp2p/switch diff --git a/tests/v2/test_wakunode_rln_relay.nim b/tests/v2/test_wakunode_rln_relay.nim index a9ecd54f5..de6bde812 100644 --- a/tests/v2/test_wakunode_rln_relay.nim +++ b/tests/v2/test_wakunode_rln_relay.nim @@ -3,10 +3,10 @@ import std/sequtils, stew/byteutils, - stew/shims/net as stewNet, + stew/shims/net as stewNet, testutils/unittests, - chronicles, - chronos, + chronicles, + chronos, libp2p/crypto/crypto, libp2p/peerid, libp2p/multiaddress, @@ -15,12 +15,12 @@ import libp2p/protocols/pubsub/pubsub, eth/keys import - ../../waku/v2/protocol/waku_rln_relay/[waku_rln_relay_utils, - waku_rln_relay_types, - waku_rln_relay_constants], - ../../waku/v2/protocol/[waku_relay, waku_message], - ../../waku/v2/utils/peers, - ../../waku/v2/node/waku_node + ../../waku/v2/node/waku_node, + ../../waku/v2/protocol/waku_message, + ../../waku/v2/protocol/waku_rln_relay/waku_rln_relay_utils, + ../../waku/v2/protocol/waku_rln_relay/waku_rln_relay_types, + ../../waku/v2/protocol/waku_rln_relay/waku_rln_relay_constants, + ../../waku/v2/utils/peers from std/times import epochTime diff --git a/tests/v2/test_wakunode_store.nim b/tests/v2/test_wakunode_store.nim index eb182f200..267219def 100644 --- a/tests/v2/test_wakunode_store.nim +++ b/tests/v2/test_wakunode_store.nim @@ -1,7 +1,6 @@ {.used.} import - stew/byteutils, stew/shims/net as stewNet, testutils/unittests, chronicles, diff --git a/tests/whisper/test_shh_config.nim b/tests/whisper/test_shh_config.nim index 5bb938314..ce470baec 100644 --- a/tests/whisper/test_shh_config.nim +++ b/tests/whisper/test_shh_config.nim @@ -10,7 +10,7 @@ {.used.} import - std/[sequtils, options, unittest, times], + std/[sequtils, unittest, times], ../../waku/whisper/whisper_protocol as whisper suite "Whisper envelope validation": diff --git a/waku/v1/node/rpc/hexstrings.nim b/waku/v1/node/rpc/hexstrings.nim index e8f4fdff3..6a2b0c693 100644 --- a/waku/v1/node/rpc/hexstrings.nim +++ b/waku/v1/node/rpc/hexstrings.nim @@ -25,7 +25,7 @@ ]# import - stint, stew/byteutils, eth/[keys, rlp], eth/common/eth_types, + stint, stew/byteutils, eth/keys, eth/common/eth_types, ../../protocol/waku_protocol type diff --git a/waku/v1/node/rpc/rpc_types.nim b/waku/v1/node/rpc/rpc_types.nim index 245e150ae..cd1cda4bb 100644 --- a/waku/v1/node/rpc/rpc_types.nim +++ b/waku/v1/node/rpc/rpc_types.nim @@ -1,5 +1,5 @@ import - hexstrings, options, eth/[keys, rlp], + hexstrings, options, eth/keys, ../../protocol/waku_protocol #[ diff --git a/waku/v1/node/rpc/waku.nim b/waku/v1/node/rpc/waku.nim index be8db8876..141201787 100644 --- a/waku/v1/node/rpc/waku.nim +++ b/waku/v1/node/rpc/waku.nim @@ -1,6 +1,6 @@ import json_rpc/rpcserver, tables, options, sequtils, - eth/[common, rlp, keys, p2p], + eth/[common, keys, p2p], nimcrypto/[sysrand, hmac, sha2, pbkdf2], rpc_types, hexstrings, key_storage, ../../protocol/waku_protocol diff --git a/waku/v1/node/wakunode1.nim b/waku/v1/node/wakunode1.nim index 9f212fd31..146075d6a 100644 --- a/waku/v1/node/wakunode1.nim +++ b/waku/v1/node/wakunode1.nim @@ -4,8 +4,8 @@ import confutils, chronos, json_rpc/rpcserver, metrics, metrics/chronicles_support, metrics/chronos_httpserver, stew/shims/net as stewNet, - eth/[keys, p2p], eth/common/utils, - eth/p2p/[discovery, enode, peer_pool, bootnodes], + eth/[keys, p2p], + eth/p2p/[enode, peer_pool], ../../whisper/[whispernodes, whisper_protocol], ../protocol/[waku_protocol, waku_bridge], ../../common/utils/nat, diff --git a/waku/v2/node/jsonrpc/admin_api.nim b/waku/v2/node/jsonrpc/admin_api.nim index da4bb15fe..f54b58104 100644 --- a/waku/v2/node/jsonrpc/admin_api.nim +++ b/waku/v2/node/jsonrpc/admin_api.nim @@ -1,7 +1,7 @@ {.push raises: [Defect].} import - std/[options, sequtils, sets], + std/sequtils, chronicles, json_rpc/rpcserver, libp2p/[peerinfo, switch] diff --git a/waku/v2/node/rest/debug/debug_api.nim b/waku/v2/node/rest/debug/debug_api.nim index bed75a785..d0a0be0c8 100644 --- a/waku/v2/node/rest/debug/debug_api.nim +++ b/waku/v2/node/rest/debug/debug_api.nim @@ -1,7 +1,6 @@ {.push raises: [Defect].} import - stew/byteutils, chronicles, json_serialization, json_serialization/std/options, diff --git a/waku/v2/node/rest/serdes.nim b/waku/v2/node/rest/serdes.nim index fab84bdc8..a8be61ce1 100644 --- a/waku/v2/node/rest/serdes.nim +++ b/waku/v2/node/rest/serdes.nim @@ -3,10 +3,13 @@ import std/typetraits, stew/results, + stew/byteutils, chronicles, serialization, json_serialization, - json_serialization/std/[options, net, sets], + json_serialization/std/options, + json_serialization/std/net, + json_serialization/std/sets, presto/common logScope: diff --git a/waku/v2/node/waku_metrics.nim b/waku/v2/node/waku_metrics.nim index 148392ef7..4cc4008e6 100644 --- a/waku/v2/node/waku_metrics.nim +++ b/waku/v2/node/waku_metrics.nim @@ -8,10 +8,7 @@ import metrics/chronos_httpserver import ../protocol/waku_filter/protocol_metrics as filter_metrics, - ../protocol/waku_store/protocol_metrics as store_metrics, - ../protocol/waku_lightpush/protocol_metrics as lightpush_metrics, ../protocol/waku_swap/waku_swap, - ../protocol/waku_peer_exchange, ../utils/collector, ./peer_manager/peer_manager, ./waku_node @@ -19,6 +16,7 @@ import when defined(rln) or defined(rlnzerokit): import ../protocol/waku_rln_relay/waku_rln_relay_metrics + const LogInterval = 30.seconds logScope: diff --git a/waku/v2/node/waku_node.nim b/waku/v2/node/waku_node.nim index c51accb15..dfd9db223 100644 --- a/waku/v2/node/waku_node.nim +++ b/waku/v2/node/waku_node.nim @@ -11,19 +11,23 @@ import eth/p2p/discoveryv5/enr, libp2p/crypto/crypto, libp2p/protocols/ping, - libp2p/protocols/pubsub/[gossipsub, rpc/messages], + libp2p/protocols/pubsub/gossipsub, + libp2p/protocols/pubsub/rpc/messages, libp2p/nameresolving/nameresolver, - libp2p/[builders, multihash], - libp2p/transports/[transport, tcptransport, wstransport] + libp2p/builders, + libp2p/multihash, + libp2p/transports/tcptransport, + libp2p/transports/wstransport import - ../protocol/[waku_relay, waku_message], + ../protocol/waku_message, + ../protocol/waku_relay, ../protocol/waku_store, - ../protocol/waku_store/client, + ../protocol/waku_store/client as store_client, ../protocol/waku_swap/waku_swap, ../protocol/waku_filter, - ../protocol/waku_filter/client, + ../protocol/waku_filter/client as filter_client, ../protocol/waku_lightpush, - ../protocol/waku_lightpush/client, + ../protocol/waku_lightpush/client as lightpush_client, ../protocol/waku_rln_relay/waku_rln_relay_types, ../protocol/waku_peer_exchange, ../utils/peers, diff --git a/waku/v2/protocol/waku_noise/noise.nim b/waku/v2/protocol/waku_noise/noise.nim index e3f634a39..598ddb95f 100644 --- a/waku/v2/protocol/waku_noise/noise.nim +++ b/waku/v2/protocol/waku_noise/noise.nim @@ -8,15 +8,15 @@ {.push raises: [Defect].} -import std/[oids, options, strutils, tables] +import std/[options, strutils] +import stew/byteutils import chronos import chronicles import bearssl/rand -import stew/[results, byteutils, endians2] -import nimcrypto/[utils, sha2, hmac] +import stew/endians2 +import nimcrypto/[sha2, hmac] import libp2p/utility -import libp2p/errors import libp2p/crypto/[crypto, chacha20poly1305, hkdf] import libp2p/protocols/secure/secure diff --git a/waku/v2/protocol/waku_noise/noise_handshake_processing.nim b/waku/v2/protocol/waku_noise/noise_handshake_processing.nim index 399b446fb..362c3fadc 100644 --- a/waku/v2/protocol/waku_noise/noise_handshake_processing.nim +++ b/waku/v2/protocol/waku_noise/noise_handshake_processing.nim @@ -4,14 +4,12 @@ {.push raises: [Defect].} -import std/[oids, options, strutils, tables] +import std/[options, strutils, tables] import chronos import chronicles import bearssl/rand -import stew/[results, endians2] -import nimcrypto/[utils, sha2, hmac] +import stew/results -import libp2p/errors import libp2p/crypto/[chacha20poly1305, curve25519] import ./noise_types diff --git a/waku/v2/protocol/waku_noise/noise_types.nim b/waku/v2/protocol/waku_noise/noise_types.nim index 911803010..b66e34b5b 100644 --- a/waku/v2/protocol/waku_noise/noise_types.nim +++ b/waku/v2/protocol/waku_noise/noise_types.nim @@ -7,12 +7,11 @@ {.push raises: [Defect].} -import std/[options, strutils, tables] +import std/[options, tables] import chronos import chronicles import bearssl -import stew/[results, endians2] -import nimcrypto/[utils, sha2, hmac] +import nimcrypto/[sha2, hmac] import libp2p/errors import libp2p/crypto/[crypto, chacha20poly1305, curve25519] diff --git a/waku/v2/protocol/waku_noise/noise_utils.nim b/waku/v2/protocol/waku_noise/noise_utils.nim index a16208e68..67bf81675 100644 --- a/waku/v2/protocol/waku_noise/noise_utils.nim +++ b/waku/v2/protocol/waku_noise/noise_utils.nim @@ -10,9 +10,8 @@ import chronos import chronicles import bearssl/rand import stew/[results, endians2, byteutils] -import nimcrypto/[utils, sha2, hmac] +import nimcrypto/[sha2, hmac] -import libp2p/errors import libp2p/crypto/[chacha20poly1305, curve25519, hkdf] import ./noise_types diff --git a/waku/v2/protocol/waku_peer_exchange/protocol.nim b/waku/v2/protocol/waku_peer_exchange/protocol.nim index 3ed514f3c..6a095aa01 100644 --- a/waku/v2/protocol/waku_peer_exchange/protocol.nim +++ b/waku/v2/protocol/waku_peer_exchange/protocol.nim @@ -10,7 +10,6 @@ import import ../../node/peer_manager/peer_manager, ../../node/discv5/waku_discv5, - ../../utils/requests, ../waku_message, ../waku_relay, ./rpc, diff --git a/waku/v2/protocol/waku_rln_relay/waku_rln_relay_types.nim b/waku/v2/protocol/waku_rln_relay/waku_rln_relay_types.nim index 1dc3f3da4..7da4c6a0e 100644 --- a/waku/v2/protocol/waku_rln_relay/waku_rln_relay_types.nim +++ b/waku/v2/protocol/waku_rln_relay/waku_rln_relay_types.nim @@ -1,15 +1,17 @@ {.push raises: [Defect].} import - std/[tables, deques], - options, chronos, stint, + std/[options, tables, deques], + stew/arrayops, + chronos, + stint, web3, eth/keys, - libp2p/protobuf/minprotobuf, - stew/arrayops, - waku_rln_relay_constants, + libp2p/protobuf/minprotobuf +import ../../utils/protobuf + type RlnRelayResult*[T] = Result[T, string] when defined(rln) or (not defined(rln) and not defined(rlnzerokit)): diff --git a/waku/v2/protocol/waku_store/rpc.nim b/waku/v2/protocol/waku_store/rpc.nim index 7dac64ff5..1dc0b8717 100644 --- a/waku/v2/protocol/waku_store/rpc.nim +++ b/waku/v2/protocol/waku_store/rpc.nim @@ -1,10 +1,8 @@ {.push raises: [Defect].} import - nimcrypto/hash -import - ../waku_message, ../../utils/time, + ../waku_message, ./pagination