-
Notifications
You must be signed in to change notification settings - Fork 181
feat(tests): Additional EIP-7934 test cases #1890
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
Conversation
6335dc3
to
cd39587
Compare
a2146f9
to
eab5984
Compare
Hmm having a difficult time reproducing this CI error locally. I added the concept of a @pytest.fixture
def type_2_default_transaction(sender):
return Transaction(...) Something in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thanks for implementing this.
I wrote a couple of comments that might be worth considering.
- Move default transaction logic to a ``conftest.py`` setup. - Add ``conftest.py`` files for each fork with the respective transaction pytest fixtures. - Opt for `Type | None` over `Optional[Type]` to avoid an extra import.
- Move default transaction logic to a ``conftest.py`` setup. - Add ``conftest.py`` files for each fork with the respective transaction pytest fixtures. - Opt for `Type | None` over `Optional[Type]` to avoid an extra import.
8451823
to
d26c90b
Compare
I'm just missing the documentation here which I can update but we should get consensus on the code first and then I can document the changes appropriately and add the release notes. |
- Move default transaction logic to a ``conftest.py`` setup. - Add ``conftest.py`` files for each fork with the respective transaction pytest fixtures. - Opt for `Type | None` over `Optional[Type]` to avoid an extra import.
d26c90b
to
39d2880
Compare
- Move transaction fixtures to a `shared` pytest plugin. - Opt for `Type | None` over `Optional[Type]` to avoid an extra import. Bonus: - Refactor the `indirect` marker logic to be more generic for future use. If a marker uses `indirect`, it will take the values from the `fork_attribute_name` and run it through a fixture of name `argnames` which provides some added logic. In this case it builds default transactions from the `tx_types` values for each fork.
3fc79fd
to
619bbaa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work, it's a very nice solution and thanks for removing the sender from the tests, it's a nice code reduction in general :)
I pushed a small change to fix the imports in the pytest .ini files, basically, anything that imported pytest_plugins.shared.execute_fill
should also have transaction_fixtures
.
Will merge after CI passes!
Ah, yeah, thanks for that cleanup! Do you want me to add any documentation around it? It was also missing a release note because we hadn't agreed yet on the path but I can add one before merge, lmk. |
Yeah I guess it would be nice to have some docs in https://github.com/ethereum/execution-spec-tests/blob/main/docs/writing_tests/test_markers.md#pytestmarkwith_all_tx_types, thanks! |
6f13934
to
e276ca6
Compare
- Create global fixtures for default transactions that are covariant with ``fork`` - These should allow overriding particular default transactions by re-defining the fixture for the particular tx type e.g.: ```python @pytest.fixture def type_2_default_transaction(pre): return Transaction(...) ``` - Use these as part of the ``fork`` plugin
- Move transaction fixtures to a `shared` pytest plugin. - Opt for `Type | None` over `Optional[Type]` to avoid an extra import. Bonus: - Refactor the `indirect` marker logic to be more generic for future use. If a marker uses `indirect`, it will take the values from the `fork_attribute_name` and run it through a fixture of name `argnames` which provides some added logic. In this case it builds default transactions from the `tx_types` values for each fork.
e276ca6
to
5604a7e
Compare
Ok ready on my end @marioevz ๐๐ผ
|
๐๏ธ Description
๐ Related Issues or PRs
Related to ethereum/execution-specs#1562
TODO:
with_all_tx_types
into something that can be more useful across the board. I'm thinking default transactions that each fork can define if it includes a new tx type and tests can automatically use these transactions, override them as fixtures, or some other more useful flow than re-building every time.with_all_typed_transactions
indirect (new feature) markerโ Checklist
tox
checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:uvx --with=tox-uv tox -e lint,typecheck,spellcheck,markdownlint
type(scope):
.mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.