Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytest: Parametrize fork covariant parameters #253

Merged
merged 9 commits into from
Aug 16, 2023

Conversation

marioevz
Copy link
Member

@marioevz marioevz commented Aug 10, 2023

Changes Included

Forks

Forks now have tx_types and precompiles methods, which must return all valid transaction types and enabled precompiles in the given fork.

Pytest Plugins: Forks

Introduce covariant parameter markers, which allow to parametrize a test with all valid values for a given property on a given fork.

  • @pytest.mark.with_all_tx_types
  • @pytest.mark.with_all_precompiles

E.g. using @pytest.mark.with_all_tx_types the tester can now specify that the test must be parametrized on each fork with all the valid transaction type numbers as a parameter at that specific fork, (Shanghai: [0, 1, 2], Cancun: [0, 1, 2, 3]), and eventually, on future forks, it should be parametrized using newer transaction types.

@marioevz marioevz changed the title Tx precompiles marks pytest: Parametrize fork covariant parameters Aug 10, 2023
Copy link
Member

@danceratopz danceratopz left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@danceratopz danceratopz left a comment

Choose a reason for hiding this comment

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

This got lost in the other review :)

@marioevz marioevz marked this pull request as ready for review August 16, 2023 15:59
@marioevz marioevz merged commit 95cde75 into ethereum:main Aug 16, 2023
5 checks passed
@marioevz marioevz deleted the tx-precompiles-marks branch August 16, 2023 17:09
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