Skip to content

Commit

Permalink
US-317: PDT - Update listen to get correct timestamp (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
WuBruno authored Nov 1, 2023
1 parent c1e86b0 commit 28f5168
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion products/pdt/pdtdb/src/values/microblock.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use std::ops::Mul;

use crate::utils::{self};
use anyhow::{anyhow, Result};
use base64::Engine;
use ethers::types::{Block, Transaction, Withdrawal};
use ethers::types::{Block, Transaction, Withdrawal, U256};
// use hex;
use crate::zqproj::PSQLInsertable;
use pdtlib::proto::ProtoMicroBlock;
Expand Down Expand Up @@ -271,6 +273,7 @@ impl BQMicroblock {
));
let timestamp: i64 = val
.timestamp
.mul(U256::from(1000)) // pad to convert: milliseconds -> microseconds
.try_into()
.expect("timestamp should fit in an i64!");
let eth_parent_hash = Some(encode_u8(val.parent_hash.as_bytes()));
Expand Down

0 comments on commit 28f5168

Please sign in to comment.