mirror of
https://github.com/logos-messaging/logos-delivery.git
synced 2026-08-04 10:53:19 +00:00
fix nph formattings
This commit is contained in:
parent
20f0b4ad3e
commit
ed2a3f8649
@ -1,6 +1,7 @@
|
||||
import std/[atomics, options]
|
||||
import chronicles, chronos, chronos/threadsync, ffi
|
||||
import logos_delivery/waku/factory/waku, logos_delivery/waku/node/waku_node, ./declare_lib
|
||||
import
|
||||
logos_delivery/waku/factory/waku, logos_delivery/waku/node/waku_node, ./declare_lib
|
||||
|
||||
################################################################################
|
||||
## Include different APIs, i.e. all procs with {.ffi.} pragma
|
||||
|
||||
@ -9,7 +9,10 @@ import
|
||||
metrics,
|
||||
ffi
|
||||
import
|
||||
logos_delivery/waku/factory/waku, logos_delivery/waku/node/waku_node, logos_delivery/waku/node/health_monitor, library/declare_lib
|
||||
logos_delivery/waku/factory/waku,
|
||||
logos_delivery/waku/node/waku_node,
|
||||
logos_delivery/waku/node/health_monitor,
|
||||
library/declare_lib
|
||||
|
||||
proc getMultiaddresses(node: WakuNode): seq[string] =
|
||||
return node.info().listenAddresses
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
import std/[sequtils, strutils, tables]
|
||||
import chronicles, chronos, results, options, json, ffi
|
||||
import logos_delivery/waku/factory/waku, logos_delivery/waku/node/waku_node, logos_delivery/waku/node/peer_manager, ../declare_lib
|
||||
import
|
||||
logos_delivery/waku/factory/waku,
|
||||
logos_delivery/waku/node/waku_node,
|
||||
logos_delivery/waku/node/peer_manager,
|
||||
../declare_lib
|
||||
|
||||
type PeerInfo = object
|
||||
protocols: seq[string]
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
import std/[json, strutils]
|
||||
import chronos, results, ffi
|
||||
import libp2p/[protocols/ping, switch, multiaddress, multicodec]
|
||||
import logos_delivery/waku/[factory/waku, waku_core/peers, node/waku_node], library/declare_lib
|
||||
import
|
||||
logos_delivery/waku/[factory/waku, waku_core/peers, node/waku_node],
|
||||
library/declare_lib
|
||||
|
||||
proc waku_ping_peer(
|
||||
ctx: ptr FFIContext[Waku],
|
||||
|
||||
@ -277,7 +277,9 @@ proc onReadyToSend(
|
||||
MessageErrorEvent.emit(
|
||||
self.brokerCtx,
|
||||
MessageErrorEvent(
|
||||
requestId: channelReqId, messageHash: "", error: "messaging send failed: " & error
|
||||
requestId: channelReqId,
|
||||
messageHash: "",
|
||||
error: "messaging send failed: " & error,
|
||||
),
|
||||
)
|
||||
self.markSegmentFailed(channelReqId)
|
||||
|
||||
@ -23,8 +23,7 @@ export reliable_channel
|
||||
|
||||
type ReliableChannelManager* = ref object
|
||||
channels: Table[ChannelId, ReliableChannel]
|
||||
messagingClient: MessagingClient
|
||||
## Borrowed from the owning `Waku`.
|
||||
messagingClient: MessagingClient ## Borrowed from the owning `Waku`.
|
||||
sendHandler: SendHandler
|
||||
## Default egress dispatch for channels created through this manager.
|
||||
## Constructed at mount time as a closure over `MessagingClient.send`
|
||||
@ -97,11 +96,7 @@ proc createReliableChannel*(
|
||||
epochPeriodSec: DefaultEpochPeriodSec, messagesPerEpoch: DefaultMessagesPerEpoch
|
||||
)
|
||||
|
||||
let effectiveSendHandler =
|
||||
if sendHandler.isNil():
|
||||
self.sendHandler
|
||||
else:
|
||||
sendHandler
|
||||
let effectiveSendHandler = if sendHandler.isNil(): self.sendHandler else: sendHandler
|
||||
|
||||
let chn = ReliableChannel.new(
|
||||
sendHandler = effectiveSendHandler,
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
{.push raises: [].}
|
||||
|
||||
import std/[tables, strutils, os], results, chronicles
|
||||
import logos_delivery/waku/common/databases/db_sqlite, logos_delivery/waku/common/databases/common
|
||||
import
|
||||
logos_delivery/waku/common/databases/db_sqlite,
|
||||
logos_delivery/waku/common/databases/common
|
||||
|
||||
logScope:
|
||||
topics = "waku node delivery_service"
|
||||
|
||||
@ -9,7 +9,9 @@
|
||||
|
||||
import results
|
||||
import
|
||||
logos_delivery/waku/common/databases/db_sqlite, logos_delivery/waku/waku_core/message/message, ./migrations
|
||||
logos_delivery/waku/common/databases/db_sqlite,
|
||||
logos_delivery/waku/waku_core/message/message,
|
||||
./migrations
|
||||
|
||||
const NotDeliveredMessagesDbUrl = "not-delivered-messages.db"
|
||||
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
import std/[options, times], chronos
|
||||
import brokers/broker_context
|
||||
import logos_delivery/waku/waku_core, logos_delivery/waku/api/types, logos_delivery/waku/requests/node_requests
|
||||
import
|
||||
logos_delivery/waku/waku_core,
|
||||
logos_delivery/waku/api/types,
|
||||
logos_delivery/waku/requests/node_requests
|
||||
|
||||
type DeliveryState* {.pure.} = enum
|
||||
Entry
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
import chronicles, chronos, results
|
||||
import std/options
|
||||
import brokers/broker_context
|
||||
import logos_delivery/waku/node/peer_manager, logos_delivery/waku/waku_core, logos_delivery/waku/waku_lightpush/[common, client, rpc]
|
||||
import
|
||||
logos_delivery/waku/node/peer_manager,
|
||||
logos_delivery/waku/waku_core,
|
||||
logos_delivery/waku/waku_lightpush/[common, client, rpc]
|
||||
|
||||
import ./[delivery_task, send_processor]
|
||||
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
import logos_delivery/waku/waku_enr/capabilities, logos_delivery/waku/waku_rendezvous/waku_peer_record
|
||||
import
|
||||
logos_delivery/waku/waku_enr/capabilities,
|
||||
logos_delivery/waku/waku_rendezvous/waku_peer_record
|
||||
|
||||
type GetShards* = proc(): seq[uint16] {.closure, gcsafe, raises: [].}
|
||||
|
||||
|
||||
@ -10,7 +10,9 @@ import
|
||||
eth/keys as eth_keys,
|
||||
eth/p2p/discoveryv5/node,
|
||||
eth/p2p/discoveryv5/protocol
|
||||
import logos_delivery/waku/[net/auto_port, node/peer_manager/peer_manager, waku_core, waku_enr]
|
||||
import
|
||||
logos_delivery/waku/
|
||||
[net/auto_port, node/peer_manager/peer_manager, waku_core, waku_enr]
|
||||
|
||||
export protocol, waku_enr
|
||||
|
||||
|
||||
@ -8,7 +8,9 @@ import
|
||||
std/[options, sequtils, net],
|
||||
results
|
||||
|
||||
import logos_delivery/waku/[common/utils/nat, net/net_config, waku_enr, waku_core], ./waku_conf
|
||||
import
|
||||
logos_delivery/waku/[common/utils/nat, net/net_config, waku_enr, waku_core],
|
||||
./waku_conf
|
||||
|
||||
proc tryBuildEnrRecord(
|
||||
conf: WakuConf, netConfig: NetConfig, multiaddrs: seq[MultiAddress]
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
|
||||
import chronicles, chronos, metrics, metrics/chronos_httpserver
|
||||
import
|
||||
logos_delivery/waku/[net/auto_port, waku_rln_relay/protocol_metrics as rln_metrics, utils/collector],
|
||||
logos_delivery/waku/
|
||||
[net/auto_port, waku_rln_relay/protocol_metrics as rln_metrics, utils/collector],
|
||||
./peer_manager,
|
||||
./node_telemetry,
|
||||
./waku_node
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
import brokers/request_broker
|
||||
|
||||
import logos_delivery/waku/api/types
|
||||
import logos_delivery/waku/node/health_monitor/[protocol_health, topic_health, health_report]
|
||||
import
|
||||
logos_delivery/waku/node/health_monitor/[protocol_health, topic_health, health_report]
|
||||
import logos_delivery/waku/waku_core/topics
|
||||
import logos_delivery/waku/common/waku_protocol
|
||||
|
||||
|
||||
@ -12,7 +12,8 @@ import
|
||||
logos_delivery/waku/rest_api/endpoint/debug/handlers as rest_debug_endpoint,
|
||||
logos_delivery/waku/rest_api/endpoint/relay/handlers as rest_relay_endpoint,
|
||||
logos_delivery/waku/rest_api/endpoint/filter/handlers as rest_filter_endpoint,
|
||||
logos_delivery/waku/rest_api/endpoint/legacy_lightpush/handlers as rest_legacy_lightpush_endpoint,
|
||||
logos_delivery/waku/rest_api/endpoint/legacy_lightpush/handlers as
|
||||
rest_legacy_lightpush_endpoint,
|
||||
logos_delivery/waku/rest_api/endpoint/lightpush/handlers as rest_lightpush_endpoint,
|
||||
logos_delivery/waku/rest_api/endpoint/store/handlers as rest_store_endpoint,
|
||||
logos_delivery/waku/rest_api/endpoint/health/handlers as rest_health_endpoint,
|
||||
|
||||
@ -8,7 +8,8 @@ import ../testlib/[common, wakucore, wakunode, testasync]
|
||||
import
|
||||
logos_delivery,
|
||||
logos_delivery/waku/[waku_node, waku_core, waku_relay/protocol],
|
||||
logos_delivery/waku/node/health_monitor/[topic_health, health_status, protocol_health, health_report],
|
||||
logos_delivery/waku/node/health_monitor/
|
||||
[topic_health, health_status, protocol_health, health_report],
|
||||
logos_delivery/waku/requests/health_requests,
|
||||
logos_delivery/waku/requests/node_requests,
|
||||
logos_delivery/waku/events/health_events,
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
{.used.}
|
||||
|
||||
import std/[strutils, os], results, testutils/unittests
|
||||
import logos_delivery/waku/common/databases/db_sqlite {.all.}, ../waku_archive/archive_utils
|
||||
import
|
||||
logos_delivery/waku/common/databases/db_sqlite {.all.}, ../waku_archive/archive_utils
|
||||
|
||||
template sourceDir(): string =
|
||||
currentSourcePath.rsplit(DirSep, 1)[0]
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
import std/options, testutils/unittests, chronos, web3
|
||||
|
||||
import logos_delivery/waku/incentivization/reputation_manager, logos_delivery/waku/waku_lightpush_legacy/rpc
|
||||
import
|
||||
logos_delivery/waku/incentivization/reputation_manager,
|
||||
logos_delivery/waku/waku_lightpush_legacy/rpc
|
||||
|
||||
suite "Waku Incentivization PoC Reputation":
|
||||
var manager {.threadvar.}: ReputationManager
|
||||
|
||||
@ -7,7 +7,9 @@ import
|
||||
|
||||
import std/[tables, strutils, os], results, chronicles
|
||||
|
||||
import logos_delivery/waku/common/databases/db_sqlite, logos_delivery/waku/common/databases/common
|
||||
import
|
||||
logos_delivery/waku/common/databases/db_sqlite,
|
||||
logos_delivery/waku/common/databases/common
|
||||
|
||||
suite "Migrations":
|
||||
test "migrate ok":
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
import results, testutils/unittests
|
||||
|
||||
import logos_delivery/waku/node/peer_manager/peer_store/peer_storage, logos_delivery/waku/waku_core/peers
|
||||
import
|
||||
logos_delivery/waku/node/peer_manager/peer_store/peer_storage,
|
||||
logos_delivery/waku/waku_core/peers
|
||||
|
||||
suite "PeerStorage":
|
||||
var peerStorage {.threadvar.}: PeerStorage
|
||||
|
||||
@ -7,7 +7,9 @@ import
|
||||
eth/p2p/discoveryv5/enr,
|
||||
nimcrypto/utils
|
||||
|
||||
import logos_delivery/waku/waku_core/peers, logos_delivery/waku/node/peer_manager/peer_store/waku_peer_storage
|
||||
import
|
||||
logos_delivery/waku/waku_core/peers,
|
||||
logos_delivery/waku/node/peer_manager/peer_store/waku_peer_storage
|
||||
|
||||
proc `==`(a, b: RemotePeerInfo): bool =
|
||||
let comparisons = @[
|
||||
|
||||
@ -8,7 +8,8 @@ import
|
||||
libp2p/crypto/crypto
|
||||
|
||||
import
|
||||
logos_delivery/waku/[waku_core, node/peer_manager, waku_node, waku_lightpush, waku_rln_relay],
|
||||
logos_delivery/waku/
|
||||
[waku_core, node/peer_manager, waku_node, waku_lightpush, waku_rln_relay],
|
||||
../testlib/[wakucore, wakunode, testasync, futures],
|
||||
../resources/payloads,
|
||||
../waku_rln_relay/[rln/waku_rln_relay_utils, utils_onchain]
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import std/options, results
|
||||
import
|
||||
logos_delivery/waku/[node/peer_manager, node/waku_node, waku_enr/sharding, common/enr/typed_record],
|
||||
logos_delivery/waku/
|
||||
[node/peer_manager, node/waku_node, waku_enr/sharding, common/enr/typed_record],
|
||||
../testlib/[wakucore]
|
||||
|
||||
proc relayShards*(node: WakuNode): RelayShards =
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
{.used.}
|
||||
|
||||
import std/[sets, random], results, stew/byteutils, testutils/unittests
|
||||
import logos_delivery/waku/waku_core, logos_delivery/waku/rest_api/message_cache, ./testlib/wakucore
|
||||
import
|
||||
logos_delivery/waku/waku_core,
|
||||
logos_delivery/waku/rest_api/message_cache,
|
||||
./testlib/wakucore
|
||||
|
||||
randomize()
|
||||
|
||||
|
||||
@ -7,7 +7,11 @@ import
|
||||
libp2p/peerid,
|
||||
libp2p/protocols/pubsub/gossipsub
|
||||
|
||||
import logos_delivery/waku/waku_core, logos_delivery/waku/waku_node, ./testlib/wakucore, ./testlib/wakunode
|
||||
import
|
||||
logos_delivery/waku/waku_core,
|
||||
logos_delivery/waku/waku_node,
|
||||
./testlib/wakucore,
|
||||
./testlib/wakunode
|
||||
|
||||
procSuite "Relay (GossipSub) Peer Exchange":
|
||||
asyncTest "Mount relay without peer exchange handler":
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
{.used.}
|
||||
|
||||
import testutils/unittests
|
||||
import results, logos_delivery/waku/waku_core/message, logos_delivery/waku/waku_core/time, ./testlib/common
|
||||
import
|
||||
results,
|
||||
logos_delivery/waku/waku_core/message,
|
||||
logos_delivery/waku/waku_core/time,
|
||||
./testlib/common
|
||||
|
||||
suite "Waku Payload":
|
||||
test "Encode/Decode waku message with timestamp":
|
||||
|
||||
@ -2,7 +2,10 @@
|
||||
|
||||
import std/[options, sequtils, tables], testutils/unittests, chronos, chronicles
|
||||
import
|
||||
logos_delivery/waku/waku_metadata, logos_delivery/waku/waku_metadata/rpc, ./testlib/wakucore, ./testlib/wakunode
|
||||
logos_delivery/waku/waku_metadata,
|
||||
logos_delivery/waku/waku_metadata/rpc,
|
||||
./testlib/wakucore,
|
||||
./testlib/wakunode
|
||||
|
||||
procSuite "Waku Protobufs":
|
||||
# TODO: Missing test coverage in many encode/decode protobuf functions
|
||||
|
||||
@ -17,7 +17,9 @@ import
|
||||
eth/p2p/discoveryv5/enr,
|
||||
eth/net/utils
|
||||
import
|
||||
logos_delivery/waku/[waku_core, waku_node, node/peer_manager], ./testlib/wakucore, ./testlib/wakunode
|
||||
logos_delivery/waku/[waku_core, waku_node, node/peer_manager],
|
||||
./testlib/wakucore,
|
||||
./testlib/wakunode
|
||||
|
||||
suite "WakuNode":
|
||||
asyncTest "Protocol matcher works as expected":
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
{.used.}
|
||||
|
||||
import std/random, testutils/unittests
|
||||
import logos_delivery/waku/waku_core, logos_delivery/waku/waku_archive/driver/queue_driver/index
|
||||
import
|
||||
logos_delivery/waku/waku_core,
|
||||
logos_delivery/waku/waku_archive/driver/queue_driver/index
|
||||
|
||||
var rng = initRand()
|
||||
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
{.used.}
|
||||
|
||||
import testutils/unittests, chronos
|
||||
import logos_delivery/waku/waku_archive/driver/postgres_driver/partitions_manager, logos_delivery/waku/waku_core/time
|
||||
import
|
||||
logos_delivery/waku/waku_archive/driver/postgres_driver/partitions_manager,
|
||||
logos_delivery/waku/waku_core/time
|
||||
|
||||
suite "Partition Manager":
|
||||
test "Calculate end partition time":
|
||||
|
||||
@ -6,7 +6,9 @@ import
|
||||
libp2p/crypto/crypto as libp2p_keys,
|
||||
eth/keys as eth_keys
|
||||
|
||||
import logos_delivery/waku/[waku_enr, discovery/waku_discv5, waku_enr/sharding], ../testlib/wakucore
|
||||
import
|
||||
logos_delivery/waku/[waku_enr, discovery/waku_discv5, waku_enr/sharding],
|
||||
../testlib/wakucore
|
||||
|
||||
proc newTestEnrRecord*(
|
||||
privKey: libp2p_keys.PrivateKey,
|
||||
|
||||
@ -6,7 +6,8 @@ import
|
||||
logos_delivery/waku/node/peer_manager,
|
||||
logos_delivery/waku/waku_node,
|
||||
logos_delivery/waku/waku_core,
|
||||
logos_delivery/waku/waku_filter_v2/[common, client, subscriptions, protocol, rpc_codec],
|
||||
logos_delivery/waku/waku_filter_v2/
|
||||
[common, client, subscriptions, protocol, rpc_codec],
|
||||
../testlib/[wakucore, testasync, testutils, futures, sequtils, wakunode],
|
||||
./waku_filter_utils,
|
||||
../resources/payloads
|
||||
|
||||
@ -4,7 +4,8 @@
|
||||
import stint
|
||||
|
||||
import
|
||||
logos_delivery/waku/[waku_keystore/protocol_types, waku_rln_relay, waku_rln_relay/protocol_types]
|
||||
logos_delivery/waku/
|
||||
[waku_keystore/protocol_types, waku_rln_relay, waku_rln_relay/protocol_types]
|
||||
|
||||
func fromStrToBytesLe*(v: string): seq[byte] =
|
||||
try:
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
import std/options, testutils/unittests, chronos, libp2p/crypto/crypto
|
||||
|
||||
import
|
||||
logos_delivery/waku/[node/peer_manager, waku_core, waku_lightpush, waku_lightpush/client],
|
||||
logos_delivery/waku/
|
||||
[node/peer_manager, waku_core, waku_lightpush, waku_lightpush/client],
|
||||
../testlib/wakucore,
|
||||
./lightpush_utils
|
||||
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
import testutils/unittests, results
|
||||
|
||||
import logos_delivery/waku/waku_rln_relay/rln, logos_delivery/waku/waku_rln_relay/rln/wrappers, ./waku_rln_relay_utils
|
||||
import
|
||||
logos_delivery/waku/waku_rln_relay/rln,
|
||||
logos_delivery/waku/waku_rln_relay/rln/wrappers,
|
||||
./waku_rln_relay_utils
|
||||
|
||||
suite "membershipKeyGen":
|
||||
test "ok":
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
import std/options, chronos, chronicles
|
||||
|
||||
import
|
||||
logos_delivery/waku/[node/peer_manager, waku_store, waku_store/client], ../testlib/[common, wakucore]
|
||||
logos_delivery/waku/[node/peer_manager, waku_store, waku_store/client],
|
||||
../testlib/[common, wakucore]
|
||||
|
||||
proc newTestWakuStore*(
|
||||
switch: Switch, handler: StoreQueryRequestHandler
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
import std/[options, sets], testutils/unittests, chronos, libp2p/crypto/crypto
|
||||
|
||||
import
|
||||
logos_delivery/waku/[node/peer_manager, waku_core, waku_store, waku_store/client, common/paging],
|
||||
logos_delivery/waku/
|
||||
[node/peer_manager, waku_core, waku_store, waku_store/client, common/paging],
|
||||
../testlib/[wakucore, testasync, futures],
|
||||
./store_utils
|
||||
|
||||
|
||||
@ -12,7 +12,8 @@ import
|
||||
libp2p/multihash,
|
||||
secp256k1
|
||||
import
|
||||
logos_delivery/waku/[waku_core, node/peer_manager, waku_node, factory/validator_signed],
|
||||
logos_delivery/waku/
|
||||
[waku_core, node/peer_manager, waku_node, factory/validator_signed],
|
||||
tools/confutils/cli_args,
|
||||
../testlib/wakucore,
|
||||
../testlib/wakunode
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
{.used.}
|
||||
|
||||
import results, stew/byteutils, testutils/unittests, json_serialization
|
||||
import logos_delivery/waku/rest_api/endpoint/serdes, logos_delivery/waku/rest_api/endpoint/debug/types
|
||||
import
|
||||
logos_delivery/waku/rest_api/endpoint/serdes,
|
||||
logos_delivery/waku/rest_api/endpoint/debug/types
|
||||
|
||||
suite "Waku v2 REST API - Debug - serialization":
|
||||
suite "DebugWakuInfo - decode":
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
{.used.}
|
||||
|
||||
import results, stew/byteutils, chronicles, unittest2, json_serialization
|
||||
import logos_delivery/waku/rest_api/endpoint/serdes, logos_delivery/waku/rest_api/endpoint/debug/types
|
||||
import
|
||||
logos_delivery/waku/rest_api/endpoint/serdes,
|
||||
logos_delivery/waku/rest_api/endpoint/debug/types
|
||||
|
||||
# TODO: Decouple this test suite from the `debug_rest_interface` module by defining
|
||||
# private custom types for this test suite module
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user