Skip to content

refactor: move generate_pre_state to consensus_testing package root#550

Merged
tcoratger merged 1 commit intoleanEthereum:mainfrom
tcoratger:refactor/move-genesis-to-consensus-testing-root
Apr 9, 2026
Merged

refactor: move generate_pre_state to consensus_testing package root#550
tcoratger merged 1 commit intoleanEthereum:mainfrom
tcoratger:refactor/move-genesis-to-consensus-testing-root

Conversation

@tcoratger
Copy link
Copy Markdown
Collaborator

Summary

  • Move generate_pre_state from consensus_testing/test_types/genesis.py to consensus_testing/genesis.py — the test_types/ package is exclusively Pydantic model definitions, and a factory function doesn't belong there. The new location sits alongside keys.py, its main dependency.
  • Replace assert with ValueError for input validation — assert gets stripped by python -O and this validates caller input, not an internal invariant.
  • Clean up docstring (remove default value restating) and rename validator_listvalidators.

No downstream changes needed — all callers import from consensus_testing directly, so the public API is unchanged.

Test plan

  • uvx tox -e all-checks passes (ruff, ty, codespell, mdformat)
  • uv run pytest confirms no import breakage
  • uv run fill --fork=devnet --clean -n auto generates fixtures successfully

🤖 Generated with Claude Code

The function was misplaced in test_types/, which is otherwise exclusively
Pydantic model definitions. Move it to consensus_testing/genesis.py,
alongside keys.py which it directly depends on.

Also improves the function:
- Replace assert with ValueError for input validation
- Clean up docstring (remove default value restating)
- Rename validator_list to validators

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