Skip to content

Commit c907bd4

Browse files
committed
fmt
1 parent 21588bc commit c907bd4

File tree

2 files changed

+17
-23
lines changed

2 files changed

+17
-23
lines changed

crates/chain-orchestrator/src/lib.rs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -731,12 +731,11 @@ impl<
731731
return Err(ChainOrchestratorError::DuplicateBatchCommit(
732732
BatchInfo::new(batch_clone.index, batch_clone.hash),
733733
));
734-
} else {
735-
// TODO: once batch reverts are implemented, we need to handle this
736-
// case.
737-
// If we have a batch at the same index in the DB this means we have
738-
// missed a batch revert event.
739734
}
735+
// TODO: once batch reverts are implemented, we need to handle this
736+
// case.
737+
// If we have a batch at the same index in the DB this means we have
738+
// missed a batch revert event.
740739
}
741740

742741
// remove any batches with an index greater than the previous batch.
@@ -833,8 +832,8 @@ impl<
833832
)),
834833
1,
835834
)
836-
.await?
837-
.is_empty()
835+
.await?
836+
.is_empty()
838837
{
839838
return Err(ChainOrchestratorError::L1MessageQueueGap(
840839
l1_message.transaction.queue_index,
@@ -859,17 +858,17 @@ impl<
859858
return Err(ChainOrchestratorError::DuplicateL1Message(
860859
l1_message.transaction.queue_index,
861860
));
862-
} else {
863-
// This should not happen in normal operation as messages should be
864-
// deleted when a L1 reorg is handled, log warning.
865-
tracing::warn!(
861+
}
862+
863+
// This should not happen in normal operation as messages should be
864+
// deleted when a L1 reorg is handled, log warning.
865+
tracing::warn!(
866866
target: "scroll::chain_orchestrator",
867867
"L1 message queue index {} already exists with different hash in DB {:?} vs {:?}",
868868
l1_message.transaction.queue_index,
869869
existing_message.transaction.tx_hash(),
870870
l1_message.transaction.tx_hash()
871871
);
872-
}
873872
}
874873

875874
tx.insert_l1_message(l1_message.clone()).await?;

crates/watcher/src/lib.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,7 @@ where
223223
pub async fn run(&mut self) {
224224
loop {
225225
// Determine sleep duration based on sync state
226-
let sleep_duration = if self.is_synced {
227-
SLOW_SYNC_INTERVAL
228-
} else {
229-
Duration::ZERO
230-
};
226+
let sleep_duration = if self.is_synced { SLOW_SYNC_INTERVAL } else { Duration::ZERO };
231227

232228
// Select between receiving commands and sleeping
233229
select! {
@@ -919,7 +915,8 @@ mod tests {
919915
async fn test_should_match_unfinalized_tail() -> eyre::Result<()> {
920916
// Given
921917
let (finalized, latest, chain) = chain(10);
922-
let (mut watcher, _, _) = l1_watcher(chain, vec![], vec![], finalized.clone(), latest.clone());
918+
let (mut watcher, _, _) =
919+
l1_watcher(chain, vec![], vec![], finalized.clone(), latest.clone());
923920

924921
// When
925922
watcher.handle_latest_block(&finalized, &latest).await?;
@@ -1148,10 +1145,8 @@ mod tests {
11481145

11491146
// Then: Send reset command - this should NOT deadlock
11501147
let (new_tx, _new_rx) = mpsc::channel(2);
1151-
let reset_result = tokio::time::timeout(
1152-
Duration::from_secs(1),
1153-
handle.reset_to_block(100, new_tx),
1154-
).await;
1148+
let reset_result =
1149+
tokio::time::timeout(Duration::from_secs(1), handle.reset_to_block(100, new_tx)).await;
11551150

11561151
assert!(reset_result?.is_ok(), "Reset should succeed");
11571152

@@ -1162,4 +1157,4 @@ mod tests {
11621157

11631158
Ok(())
11641159
}
1165-
}
1160+
}

0 commit comments

Comments
 (0)