use nanosecond precision in waku timestamp (#152)

This commit is contained in:
Giacomo Pasini 2023-05-18 15:19:36 +02:00 committed by GitHub
parent bbd313f70a
commit fdc22111d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View File

@ -243,7 +243,7 @@ async fn send_transaction(
payload,
WAKU_CARNOT_TX_CONTENT_TOPIC.clone(),
1,
chrono::Utc::now().timestamp() as usize,
chrono::Utc::now().timestamp_nanos() as usize,
[],
false,
),

View File

@ -99,7 +99,7 @@ impl NetworkAdapter for MockAdapter {
String::from_utf8_lossy(&chunk_message.as_bytes()).to_string(),
MOCK_BLOCK_CONTENT_TOPIC,
1,
chrono::Utc::now().timestamp() as usize,
chrono::Utc::now().timestamp_nanos() as usize,
);
if let Err((e, _)) = self
.network_relay
@ -166,7 +166,7 @@ impl NetworkAdapter for MockAdapter {
String::from_utf8_lossy(&approval_message.as_bytes()).to_string(),
MOCK_APPROVAL_CONTENT_TOPIC,
1,
chrono::Utc::now().timestamp() as usize,
chrono::Utc::now().timestamp_nanos() as usize,
);
if let Err((e, _e)) = self
.network_relay

View File

@ -116,7 +116,7 @@ impl WakuAdapter {
bytes,
topic,
1,
chrono::Utc::now().timestamp() as usize,
chrono::Utc::now().timestamp_nanos() as usize,
[],
false,
);
@ -226,7 +226,7 @@ impl NetworkAdapter for WakuAdapter {
approval_message.as_bytes(),
content_topic,
1,
chrono::Utc::now().timestamp() as usize,
chrono::Utc::now().timestamp_nanos() as usize,
[],
false,
);

View File

@ -354,7 +354,7 @@ mod tests {
content_topic_name: "foo content".into(),
},
version: 1,
timestamp: chrono::Utc::now().timestamp() as usize,
timestamp: chrono::Utc::now().timestamp_nanos() as usize,
},
})
.await;
@ -371,7 +371,7 @@ mod tests {
content_topic_name: "bar content".into(),
},
version: 1,
timestamp: chrono::Utc::now().timestamp() as usize,
timestamp: chrono::Utc::now().timestamp_nanos() as usize,
},
})
.await;