mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-03 22:43:09 +00:00
* Cleanup of warnings + imports, etc. * Remove connected_peers metric as there is already libp2p_pubsub_peers
27 lines
722 B
Nim
27 lines
722 B
Nim
{.used.}
|
|
|
|
import
|
|
std/[unittest, os],
|
|
confutils, chronicles, chronos, stew/shims/net as stewNet,
|
|
json_rpc/[rpcclient, rpcserver],
|
|
libp2p/crypto/crypto,
|
|
libp2p/crypto/secp,
|
|
eth/keys,
|
|
../../waku/node/v2/[config, wakunode2, waku_types],
|
|
../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
|