Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(api): fix log timestamp format #2407

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/lib/basic_types/src/web3/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ pub struct Log {
pub removed: Option<bool>,
/// L2 block timestamp
#[serde(rename = "blockTimestamp")]
pub block_timestamp: Option<i64>,
pub block_timestamp: Option<U64>,
}

impl Log {
Expand Down
2 changes: 1 addition & 1 deletion core/lib/dal/src/models/storage_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl From<StorageWeb3Log> 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()),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion core/lib/dal/src/transactions_web3_dal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion core/lib/types/src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ pub struct Log {
pub removed: Option<bool>,
/// L2 block timestamp
#[serde(rename = "blockTimestamp")]
pub block_timestamp: Option<i64>,
pub block_timestamp: Option<U64>,
}

impl Log {
Expand Down
Loading