Skip to content

Commit 26e4fcf

Browse files
committed
chore(host-listener): drop out-of-scope schedule_order extraction
Also fix clippy checked_conversions in chain_id for pre-commit.
1 parent b5fdc98 commit 26e4fcf

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

coprocessor/fhevm-engine/fhevm-engine-common/src/chain_id.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl TryFrom<u64> for ChainId {
5050
type Error = InvalidChainId;
5151

5252
fn try_from(value: u64) -> Result<Self, Self::Error> {
53-
if value <= i64::MAX as u64 {
53+
if i64::try_from(value).is_ok() {
5454
Ok(ChainId(value as i64))
5555
} else {
5656
Err(InvalidChainId {

coprocessor/fhevm-engine/host-listener/src/database/tfhe_event_propagate.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -354,11 +354,6 @@ impl Database {
354354
) -> Result<bool, SqlxError> {
355355
let is_scalar = !scalar_byte.is_zero();
356356
let output_handle = result.to_vec();
357-
let schedule_order =
358-
log.block_timestamp
359-
.saturating_add(TimeDuration::microseconds(
360-
log.tx_depth_size as i64,
361-
));
362357
let query = sqlx::query!(
363358
r#"
364359
INSERT INTO computations (
@@ -384,7 +379,10 @@ impl Database {
384379
log.dependence_chain.to_vec(),
385380
log.transaction_hash.map(|txh| txh.to_vec()),
386381
log.is_allowed,
387-
schedule_order,
382+
log.block_timestamp
383+
.saturating_add(TimeDuration::microseconds(
384+
log.tx_depth_size as i64
385+
)),
388386
!log.is_allowed,
389387
self.chain_id.as_i64()
390388
);

0 commit comments

Comments
 (0)