Conversation
Delete the unused test-helper method `FakeL1EventsProviderClient::assert_add_events_received_with` from crates/apollo_l1_events/src/test_utils.rs. Why it appears dead: - `test_utils` is gated `#[cfg(any(test, feature = "testing"))]` and is exposed to other crates through the `testing` feature, so this method is part of the crate's cross-crate *testing* API. The rustc `dead_code` lint does not flag public items, which is why a plain build stays clean and this was not caught by the compiler. - The identifier `assert_add_events_received_with` appears exactly once in the whole starkware-libs/sequencer workspace: its own definition. There are zero call sites. The crate's own tests (l1_events_provider_tests.rs) construct FakeL1EventsProviderClient and call flush_messages, but never this assertion helper. - Not referenced in either sibling repo checked out alongside this one (starkware-industries/sequencer-devops, starkware-industries/starkware): grep of source, scripts and config found no hits. - Removing it orphans no imports: `mem`, `Itertools` (via `collect_vec`) and `Event` all remain used elsewhere in the file. This is routed as a low-confidence change because the method is `pub` testing API exported via the `testing` feature: a consumer outside the three in-scope repos could enable apollo_l1_events/testing and call it, and it may be scaffolding for a test that has not landed yet. A human owner should confirm before merging. Verified: rustfmt clean; `cargo build -p apollo_l1_events` and `cargo build -p apollo_l1_events --tests` build with zero dead_code/unused warnings; `cargo clippy -p apollo_l1_events --all-targets` clean; `SEED=0 cargo test -p apollo_l1_events` runs the unit suite green (88 passed, 0 failed, 4 ignored). The only failing test, the anvil-backed integration flow test in tests/flow_test_cancellation.rs, panics with "Anvil binary not found!" before any crate code runs -- the Foundry `anvil` binary is absent in this sandbox, so it fails identically on main and is unrelated to this deletion (that flow test never referenced the removed helper). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MZtkRKfRyFcojC9WSgGFQG
|
CI note: Why it can't be this PR's failure: the change only deletes one I've re-run the failed jobs once to confirm the flake. Generated by Claude Code |
Caution
REVIEW WITH CARE! THIS PR REQUIRES CAREFUL HUMAN REVIEW...
If you find this to be a false positive comment in detail why this code should be kept and close the PR.
Summary
Deletes the unused test-helper method
FakeL1EventsProviderClient::assert_add_events_received_withfromcrates/apollo_l1_events/src/test_utils.rs.Why it appears dead
test_utilsis gated#[cfg(any(test, feature = "testing"))]and is exposed to other crates via thetestingfeature, soassert_add_events_received_withis part of this crate's cross-crate testing API — the Rustdead_codelint does not flag it, which is why a plain build stays clean.assert_add_events_received_withappears exactly once in the entirestarkware-libs/sequencerworkspace — its own definition. There are zero call sites: the crate's own tests (l1_events_provider_tests.rs) constructFakeL1EventsProviderClientand callflush_messages, but never this assertion helper.starkware-industries/sequencer-devopsandstarkware-industries/starkware(grep of source, scripts, and config — no hits).mem,Itertoolsviacollect_vec, andEventall remain used elsewhere in the file).What a human must verify
pubtesting API exported through thetestingfeature. I cannot rule out a consumer outside the three repos in scope (e.g. another StarkWare repo not checked out here) that enablesapollo_l1_events/testingand calls this assertion helper.#[track_caller]assertion helper, so it may have been added ahead of the test that will use it.If either is true, this is a false positive — please comment why it should be kept and close the PR.
Verification
unset CI && scripts/rust_fmt.sh— clean.cargo build -p apollo_l1_eventsandcargo build -p apollo_l1_events --tests— zerodead_code/unusedwarnings.cargo clippy -p apollo_l1_events --all-targets— clean.SEED=0 cargo test -p apollo_l1_events— unit suite green (88 passed, 0 failed, 4 ignored). The one failing test, the anvil-backed integration flow test intests/flow_test_cancellation.rs, panics withAnvil binary not found!before any crate code runs — the Foundryanvilbinary is absent in this CI sandbox, so it fails identically onmainand is unrelated to this deletion.Caution
REVIEW WITH CARE! THIS PR REQUIRES CAREFUL HUMAN REVIEW...
If you find this to be a false positive comment in detail why this code should be kept and close the PR.
🤖 Generated with Claude Code
https://claude.ai/code/session_01MZtkRKfRyFcojC9WSgGFQG
Generated by Claude Code