Skip to content

refactor(types): drop unused Checkpoint.__lt__ - #754

Merged
tcoratger merged 1 commit into
leanEthereum:mainfrom
tcoratger:refactor/checkpoint-lt
May 22, 2026
Merged

refactor(types): drop unused Checkpoint.__lt__#754
tcoratger merged 1 commit into
leanEthereum:mainfrom
tcoratger:refactor/checkpoint-lt

Conversation

@tcoratger

Copy link
Copy Markdown
Collaborator

Summary

Checkpoint.__lt__ had no production caller. The forward-progress helper advance_to compares slots directly through Slot's comparator (candidate.slot > self.slot) — never ordering Checkpoint against Checkpoint.

  • src/lean_spec/types/checkpoint.py (−8): __lt__ deleted.
  • tests/lean_spec/subspecs/containers/test_checkpoint.py (−63 / +2):
    • Six __lt__ tests retired (only exercised the deleted dunder).
    • Two max(low, high) tests retired (only worked because __lt__ was defined; max/min on Checkpoint stop making sense without the comparator).
    • Four advance_to tests kept.
    • Unused pytest import dropped.
    • File docstring reworded from "Checkpoint ordering" to "advancing checkpoints by slot" since ordering is no longer tested here.

Test plan

  • ruff check src/lean_spec/types/checkpoint.py tests/lean_spec/subspecs/containers/test_checkpoint.py — clean.
  • grep across src/, tests/, packages/ — no remaining references to Checkpoint.__lt__ or to ordering Checkpoint instances against each other.

🤖 Generated with Claude Code

The dunder had no production caller; advance_to compares slots
directly through Slot's comparator rather than ordering Checkpoint
against Checkpoint. Without the dunder, max and min over Checkpoint
also stop making sense, so the two max-based tests retire along
with the six dunder-targeted tests. The four advance_to tests stay.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tcoratger
tcoratger merged commit ae94f25 into leanEthereum:main May 22, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant