mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-03 22:43:09 +00:00
- Remove wakuRelayProto as this is initiated as part of switch PubSub - Move WakuNode type into waku_types to avoid circular references - Make necessary adjustments to get tests and sim to work
29 lines
742 B
Nim
29 lines
742 B
Nim
import unittest
|
|
|
|
import confutils, chronicles, chronos, os
|
|
|
|
import stew/shims/net as stewNet
|
|
import libp2p/crypto/crypto
|
|
import libp2p/crypto/secp
|
|
import eth/keys
|
|
import json_rpc/[rpcclient, rpcserver]
|
|
|
|
import ../../waku/node/v2/[config, wakunode2, waku_types]
|
|
|
|
import ../test_helpers
|
|
|
|
procSuite "WakuNode":
|
|
asyncTest "Message published with content filter is retrievable":
|
|
let conf = WakuNodeConf.load()
|
|
let node = await WakuNode.init(conf)
|
|
|
|
let topic = "foobar"
|
|
|
|
let message = cast[seq[byte]]("hello world")
|
|
node.publish(topic, ContentFilter(contentTopic: topic), message)
|
|
|
|
let response = node.query(HistoryQuery(topics: @[topic]))
|
|
check:
|
|
response.messages.len == 1
|
|
response.messages[0] == message
|