mirror of
https://github.com/logos-messaging/logos-messaging-rust-bindings.git
synced 2026-01-02 14:03:12 +00:00
fix test compilation issue and add some more time for waku
This commit is contained in:
parent
80ea725aeb
commit
f2a6c8e86c
@ -1,6 +1,5 @@
|
||||
use std::io::Error;
|
||||
use std::str::from_utf8;
|
||||
use std::time::SystemTime;
|
||||
use tokio::time::{sleep, Duration};
|
||||
use waku::{
|
||||
general::pubsubtopic::PubsubTopic, waku_new, Encoding, LibwakuResponse, WakuContentTopic,
|
||||
@ -110,19 +109,7 @@ async fn main() -> Result<(), Error> {
|
||||
// Publish a message
|
||||
|
||||
let content_topic = WakuContentTopic::new("waku", "2", "test", Encoding::Proto);
|
||||
let message = WakuMessage::new(
|
||||
"Hello world",
|
||||
content_topic,
|
||||
0,
|
||||
SystemTime::now()
|
||||
.duration_since(SystemTime::UNIX_EPOCH)
|
||||
.unwrap()
|
||||
.as_millis()
|
||||
.try_into()
|
||||
.unwrap(),
|
||||
Vec::new(),
|
||||
false,
|
||||
);
|
||||
let message = WakuMessage::new("Hello world", content_topic, 0, Vec::new(), false);
|
||||
node1
|
||||
.relay_publish_message(&message, &topic, None)
|
||||
.await
|
||||
|
||||
@ -4,7 +4,7 @@ use secp256k1::SecretKey;
|
||||
use serial_test::serial;
|
||||
use std::str::FromStr;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::time::{Duration, SystemTime};
|
||||
use std::time::Duration;
|
||||
use std::{collections::HashSet, str::from_utf8};
|
||||
use tokio::time;
|
||||
use tokio::time::sleep;
|
||||
@ -76,7 +76,7 @@ async fn test_echo_messages(
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
sleep(Duration::from_secs(3)).await;
|
||||
sleep(Duration::from_secs(5)).await;
|
||||
|
||||
// Interconnect nodes
|
||||
// Replace all matches with 127.0.0.1 to avoid issue with NAT or firewall.
|
||||
@ -95,19 +95,7 @@ async fn test_echo_messages(
|
||||
sleep(Duration::from_secs(3)).await;
|
||||
|
||||
dbg!("Before publish");
|
||||
let message = WakuMessage::new(
|
||||
content,
|
||||
content_topic,
|
||||
1,
|
||||
SystemTime::now()
|
||||
.duration_since(SystemTime::UNIX_EPOCH)
|
||||
.unwrap()
|
||||
.as_millis()
|
||||
.try_into()
|
||||
.unwrap(),
|
||||
Vec::new(),
|
||||
false,
|
||||
);
|
||||
let message = WakuMessage::new(content, content_topic, 1, Vec::new(), false);
|
||||
let _ids = try_publish_relay_messages(&node1, &message)
|
||||
.await
|
||||
.expect("send relay messages");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user