Skip to content

refactor(tests): inline ids and descriptions in point evaluation params#2907

Merged
felix314159 merged 1 commit into
ethereum:forks/amsterdamfrom
chfast:refactor/eip4844-point-evaluation-params
May 27, 2026
Merged

refactor(tests): inline ids and descriptions in point evaluation params#2907
felix314159 merged 1 commit into
ethereum:forks/amsterdamfrom
chfast:refactor/eip4844-point-evaluation-params

Conversation

@chfast
Copy link
Copy Markdown
Member

@chfast chfast commented May 25, 2026

🗒️ Description

This is done to lower the review/maintenance cost of adding the test cases.

In test_valid_inputs and test_invalid_inputs:

  • Convert tuple params to pytest.param(..., id=...) so each case's identifier lives next to its values; drop the parallel ids=[...] list in test_invalid_inputs.
  • Move the per-case descriptions out of the function docstrings and into inline comments above the relevant pytest.param(s); shrink each docstring to a one-line summary.
  • Replace the magic 0xC0 << 376 with the existing INF_POINT constant in Spec.kzg_to_versioned_hash() calls.
  • Use idiomatic byte literals (b"", b"\x00", b"\x00" * 1023) instead of bytes() / bytes([0]) / bytes([0] * 1023).

No fixture changes (t8n cache 100% hit on all 14 cases).

🔗 Related Issues or PRs

#2909

✅ Checklist

  • All: Ran fast static checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    just static
  • All: PR title adheres to the repo standard - it will be used as the squash commit message and should start type(scope):.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.
  • Tests: For PRs implementing a missed test case, update the post-mortem document to add an entry the list.
  • Ported Tests: All converted JSON/YML tests from ethereum/tests or tests/static have been assigned @ported_from marker.

In test_valid_inputs and test_invalid_inputs:

- Convert tuple params to `pytest.param(..., id=...)` so each case's
  identifier lives next to its values; drop the parallel `ids=[...]`
  list in test_invalid_inputs.
- Move the per-case descriptions out of the function docstrings and
  into inline comments above the relevant pytest.param(s); shrink each
  docstring to a one-line summary.
- Replace the magic `0xC0 << 376` with the existing `INF_POINT`
  constant in Spec.kzg_to_versioned_hash() calls.
- Use idiomatic byte literals (`b""`, `b"\x00"`, `b"\x00" * 1023`)
  instead of `bytes()` / `bytes([0])` / `bytes([0] * 1023)`.

No fixture changes (t8n cache 100% hit on all 14 cases).
@chfast chfast force-pushed the refactor/eip4844-point-evaluation-params branch from 456f7b0 to fa5504c Compare May 25, 2026 15:46
@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.44%. Comparing base (2de6b9f) to head (fa5504c).
⚠️ Report is 1 commits behind head on forks/amsterdam.

Additional details and impacted files
@@               Coverage Diff                @@
##           forks/amsterdam    #2907   +/-   ##
================================================
  Coverage            90.44%   90.44%           
================================================
  Files                  535      535           
  Lines                32439    32439           
  Branches              3012     3012           
================================================
  Hits                 29338    29338           
  Misses                2573     2573           
  Partials               528      528           
Flag Coverage Δ
unittests 90.44% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@felix314159 felix314159 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@felix314159 felix314159 merged commit 1787c74 into ethereum:forks/amsterdam May 27, 2026
18 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.

2 participants