You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(tests): Additional EIP-7934 test cases (#1890)
* feat(tests): Add eip7934 test at rlp size with all transaction types
* feat(tests): Add eip7934 test at limit with logs
* feat(tests,plugins): Add ``with_all_typed_transactions`` support
- 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
* refactor(tests): Use ``with_all_typed_transactions`` for block rlp limit test
* refactor(tests) Changes from comments on pr #1890 and offline:
- 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.
* chore: Remove duplicate `sender` fixtures; opting for global `sender`
* fix(cli/pytest): Ini files imports
* fix(pytest_plugins): Paths and imports
* chore(docs): Document `with_all_typed_transactions` marker
---------
Co-authored-by: Mario Vega <marioevz@gmail.com>
Copy file name to clipboardExpand all lines: docs/CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -114,6 +114,7 @@ Users can select any of the artifacts depending on their testing needs for their
114
114
- ✨ Opcode classes now validate keyword arguments and raise `ValueError` with clear error messages ([#1739](https://github.com/ethereum/execution-spec-tests/pull/1739), [#1856](https://github.com/ethereum/execution-spec-tests/pull/1856)).
115
115
- ✨ All commands (`fill`, `consume`, `execute`) now work without having to clone the repository, e.g. `uv run --with git+https://github.com/ethereum/execution-spec-tests.git consume` now works from any folder ([#1863](https://github.com/ethereum/execution-spec-tests/pull/1863)).
116
116
- 🔀 Move Prague to stable and Osaka to develop ([#1573](https://github.com/ethereum/execution-spec-tests/pull/1573)).
117
+
- ✨ Add a `pytest.mark.with_all_typed_transactions` marker that creates default typed transactions for each `tx_type` supported by the current `fork` ([#1890](https://github.com/ethereum/execution-spec-tests/pull/1890)).
117
118
118
119
### 🧪 Test Cases
119
120
@@ -128,6 +129,7 @@ Users can select any of the artifacts depending on their testing needs for their
128
129
- ✨ [EIP-7934](https://eips.ethereum.org/EIPS/eip-7934): Add test cases for the block RLP max limit of 10MiB ([#1730](https://github.com/ethereum/execution-spec-tests/pull/1730)).
129
130
- ✨ [EIP-7939](https://eips.ethereum.org/EIPS/eip-7939) Add count leading zeros (CLZ) opcode tests for Osaka ([#1733](https://github.com/ethereum/execution-spec-tests/pull/1733)).
130
131
- ✨ [EIP-7918](https://eips.ethereum.org/EIPS/eip-7918): Blob base fee bounded by execution cost test cases (initial), includes some adjustments to [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844) tests ([#1685](https://github.com/ethereum/execution-spec-tests/pull/1685)). Update the blob_base_cost ([#1915](https://github.com/ethereum/EIPs/pull/1915)).
132
+
- ✨ [EIP-7934](https://eips.ethereum.org/EIPS/eip-7934): Add additional test cases for block RLP max limit with all typed transactions and for a log-creating transactions ([#1890](https://github.com/ethereum/execution-spec-tests/pull/1890)).
Copy file name to clipboardExpand all lines: docs/writing_tests/test_markers.md
+53Lines changed: 53 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,59 @@ This marker is used to automatically parameterize a test with all contract creat
55
55
56
56
This marker only differs from `pytest.mark.with_all_tx_types` in that it does not include transaction type 3 (Blob Transaction type) on fork Cancun and after.
57
57
58
+
### `@pytest.mark.with_all_typed_transactions`
59
+
60
+
This marker is used to automatically parameterize a test with all typed transactions, including `type=0` (legacy transaction), that are valid for the fork being tested.
61
+
This marker is an indirect marker that utilizes the `tx_type` values from the `pytest.mark.with_all_tx_types` marker to build default typed transactions for each `tx_type`.
62
+
63
+
Optional: Default typed transactions used as values for `typed_transaction` exist in `src/pytest_plugins/shared/transaction_fixtures.py` and can be overridden for the scope of
64
+
the test by re-defining the appropriate `pytest.fixture` for that transaction type.
65
+
66
+
```python
67
+
import pytest
68
+
69
+
from ethereum_test_tools import Account, Alloc, StateTestFiller
0 commit comments