Skip to content

refactor: extract resolve_block_root to utils and rename misleading test#602

Merged
tcoratger merged 1 commit intoleanEthereum:mainfrom
tcoratger:refactor/resolve-block-root-and-rename-test
Apr 13, 2026
Merged

refactor: extract resolve_block_root to utils and rename misleading test#602
tcoratger merged 1 commit intoleanEthereum:mainfrom
tcoratger:refactor/resolve-block-root-and-rename-test

Conversation

@tcoratger
Copy link
Copy Markdown
Collaborator

Summary

Follow-up cleanup to #599.

  • Extract the duplicated _resolve_label closure into a shared resolve_block_root function in utils.py
  • Both StoreChecks and StateExpectation now use it via a thin _resolve wrapper
  • Remove unused hash_tree_root import from state_expectation.py
  • Rename test_mid_block_resolved_target_does_not_reopen_pending_votes to test_merged_attestations_for_same_target_justify_and_finalize_cleanly — the old name implied the "already-justified skip" guard fires, but the builder merges both attestation specs into one aggregated attestation before processing

Test plan

  • All 11 finalization tests pass
  • uvx tox -e all-checks passes

🤖 Generated with Claude Code

Extract the duplicated _resolve_label closure from StoreChecks and
StateExpectation into a shared resolve_block_root function in utils.py.
Both validation methods now use a thin _resolve wrapper that delegates
to the shared function. Removes the unused hash_tree_root import from
state_expectation.py.

Rename test_mid_block_resolved_target_does_not_reopen_pending_votes
to test_merged_attestations_for_same_target_justify_and_finalize_cleanly.
The old name implied the "already-justified skip" guard fires, but the
builder merges both attestation specs into one aggregated attestation
before processing. The test verifies merging behavior, not the skip path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tcoratger tcoratger merged commit 2f3d6ed into leanEthereum:main Apr 13, 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