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