From a203d89f9fa0bbade047c0535042d843c0f562cd Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Tue, 9 Jul 2024 10:13:59 +0300 Subject: [PATCH] Fix log timestamp format --- core/lib/basic_types/src/web3/mod.rs | 2 +- core/lib/dal/src/models/storage_event.rs | 2 +- core/lib/dal/src/transactions_web3_dal.rs | 2 +- core/lib/types/src/api/mod.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/lib/basic_types/src/web3/mod.rs b/core/lib/basic_types/src/web3/mod.rs index 75bcfac62f24..9bc10c8ab364 100644 --- a/core/lib/basic_types/src/web3/mod.rs +++ b/core/lib/basic_types/src/web3/mod.rs @@ -329,7 +329,7 @@ pub struct Log { pub removed: Option, /// L2 block timestamp #[serde(rename = "blockTimestamp")] - pub block_timestamp: Option, + pub block_timestamp: Option, } impl Log { diff --git a/core/lib/dal/src/models/storage_event.rs b/core/lib/dal/src/models/storage_event.rs index 415c39001ea0..db69b6bb0e86 100644 --- a/core/lib/dal/src/models/storage_event.rs +++ b/core/lib/dal/src/models/storage_event.rs @@ -48,7 +48,7 @@ impl From for api::Log { transaction_log_index: Some(U256::from(log.event_index_in_tx as u32)), log_type: None, removed: Some(false), - block_timestamp: log.block_timestamp, + block_timestamp: log.block_timestamp.map(|t| (t as u64).into()), } } } diff --git a/core/lib/dal/src/transactions_web3_dal.rs b/core/lib/dal/src/transactions_web3_dal.rs index f207468d374c..ff82664109d6 100644 --- a/core/lib/dal/src/transactions_web3_dal.rs +++ b/core/lib/dal/src/transactions_web3_dal.rs @@ -123,7 +123,7 @@ impl TransactionsWeb3Dal<'_, '_> { .map(|mut log| { log.block_hash = Some(receipt.block_hash); log.l1_batch_number = receipt.l1_batch_number; - log.block_timestamp = block_timestamp; + log.block_timestamp = block_timestamp.map(|t| (t as u64).into()); log }) .collect(); diff --git a/core/lib/types/src/api/mod.rs b/core/lib/types/src/api/mod.rs index 9c433a4afb85..a0039ba05672 100644 --- a/core/lib/types/src/api/mod.rs +++ b/core/lib/types/src/api/mod.rs @@ -445,7 +445,7 @@ pub struct Log { pub removed: Option, /// L2 block timestamp #[serde(rename = "blockTimestamp")] - pub block_timestamp: Option, + pub block_timestamp: Option, } impl Log {