From 01342fc938e008d6cd4a9c72b6a5a949066bad26 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 4 Jul 2026 05:56:24 +0000 Subject: [PATCH] apollo_l1_events_types: delete dead code (unsure, review carefully) Removes the unused `L1EventsProviderError::UnexpectedProviderStateTransition` variant and its sole constructor `L1EventsProviderError::unexpected_transition`. Evidence it is dead: - `unexpected_transition` and `UnexpectedProviderStateTransition` each have zero references anywhere in the sequencer workspace (whole-word grep across `crates/` matches only their definitions), including tests and benches. - Both have zero references in the sibling repos `starkware-industries/sequencer-devops` and `starkware-industries/starkware`. - The variant is constructed exclusively by `unexpected_transition`, so with that method removed the variant can never be produced. The other `L1EventsProviderError` variants (`Uninitialized`, `UnexpectedHeight`, `UnexpectedProviderState`) are retained and still used. Verification (env: RUSTC_WRAPPER unset, CARGO_INCREMENTAL=0): `cargo build -p apollo_l1_events_types` and `cargo build -p apollo_l1_events_types --tests` build with zero dead_code/unused warnings; `cargo clippy` clean; `cargo test` passes. --- crates/apollo_l1_events_types/src/errors.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/crates/apollo_l1_events_types/src/errors.rs b/crates/apollo_l1_events_types/src/errors.rs index e1207928cb6..f87b5552a3d 100644 --- a/crates/apollo_l1_events_types/src/errors.rs +++ b/crates/apollo_l1_events_types/src/errors.rs @@ -18,14 +18,6 @@ pub enum L1EventsProviderError { UnexpectedHeight { expected_height: BlockNumber, got: BlockNumber }, #[error("Unexpected provider state: {expected}, got: {found}")] UnexpectedProviderState { expected: ProviderState, found: ProviderState }, - #[error("Cannot transition from {from} to {to}")] - UnexpectedProviderStateTransition { from: String, to: String }, -} - -impl L1EventsProviderError { - pub fn unexpected_transition(from: impl ToString, to: impl ToString) -> Self { - Self::UnexpectedProviderStateTransition { from: from.to_string(), to: to.to_string() } - } } #[derive(Clone, Debug, Error)]