Skip to content

Commit 0b5851d

Browse files
committed
fix: revert timestamp response to ms
1 parent f76d16c commit 0b5851d

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

pragma-entities/src/dto/entry.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl From<crate::Entry> for Entry {
2727
pair_id: entry.pair_id,
2828
publisher: entry.publisher,
2929
source: entry.source,
30-
timestamp: entry.timestamp.and_utc().timestamp() as u64,
30+
timestamp: entry.timestamp.and_utc().timestamp_millis() as u64,
3131
price: entry.price.to_u128().unwrap_or(0), // change default value ?
3232
}
3333
}

pragma-node/src/handlers/entries/get_entry.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ fn adapt_entry_to_entry_response(
8383
) -> GetEntryResponse {
8484
GetEntryResponse {
8585
pair_id,
86-
timestamp: entry.time.and_utc().timestamp() as u64,
86+
timestamp: entry.time.and_utc().timestamp_millis() as u64,
8787
num_sources_aggregated: entry.num_sources as usize,
8888
price: format!(
8989
"0x{}",

pragma-node/src/handlers/entries/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ pub struct GetEntryParams {
150150
impl Default for GetEntryParams {
151151
fn default() -> Self {
152152
Self {
153-
timestamp: Some(chrono::Utc::now().timestamp()),
153+
timestamp: Some(chrono::Utc::now().timestamp_millis()),
154154
interval: Some(Interval::default()),
155155
routing: Some(false),
156156
aggregation: Some(AggregationMode::default()),

0 commit comments

Comments
 (0)