Skip to content

Commit

Permalink
fix(tests): EOF - EIP-4200: Organize code_validation_jump.py tests (#666
Browse files Browse the repository at this point in the history
)

* fix(fw): Opcodes length

* feat(fw): Add EOF exception

* refactor(tests): code_validation_jump.py into dedicated files
  • Loading branch information
marioevz authored Jul 4, 2024
1 parent 891a611 commit 12ceb22
Show file tree
Hide file tree
Showing 8 changed files with 416 additions and 1,041 deletions.
2 changes: 1 addition & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Test fixtures for use by clients are available for each release on the [Github r
- ✨ Add tests for [EIP-7002: Execution layer triggerable withdrawals](https://eips.ethereum.org/EIPS/eip-7002) ([#530](https://github.com/ethereum/execution-spec-tests/pull/530)).
- ✨ Add tests for [EIP-7685: General purpose execution layer requests](https://eips.ethereum.org/EIPS/eip-7685) ([#530](https://github.com/ethereum/execution-spec-tests/pull/530)).
- ✨ Add tests for [EIP-2935: Serve historical block hashes from state](https://eips.ethereum.org/EIPS/eip-2935) ([#564](https://github.com/ethereum/execution-spec-tests/pull/564), [#585](https://github.com/ethereum/execution-spec-tests/pull/585)).
- ✨ Add tests for [EIP-4200: EOF - Static relative jumps](https://eips.ethereum.org/EIPS/eip-4200) ([#581](https://github.com/ethereum/execution-spec-tests/pull/581)).
- ✨ Add tests for [EIP-4200: EOF - Static relative jumps](https://eips.ethereum.org/EIPS/eip-4200) ([#581](https://github.com/ethereum/execution-spec-tests/pull/581), [#666](https://github.com/ethereum/execution-spec-tests/pull/666)).
- ✨ Add tests for [EIP-7069: EOF - Revamped CALL instructions](https://eips.ethereum.org/EIPS/eip-7069) ([#595](https://github.com/ethereum/execution-spec-tests/pull/595)).
- 🐞 Fix typos in self-destruct collision test from erroneous pytest parametrization ([#608](https://github.com/ethereum/execution-spec-tests/pull/608)).
- ✨ Add tests for [EIP-3540: EOF - EVM Object Format v1](https://eips.ethereum.org/EIPS/eip-3540) ([#634](https://github.com/ethereum/execution-spec-tests/pull/634)).
Expand Down
1 change: 1 addition & 0 deletions src/ethereum_test_tools/exceptions/evmone_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class EvmoneExceptionMapper:
ExceptionMessage(
EOFException.INCOMPATIBLE_CONTAINER_KIND, "err: incompatible_container_kind"
),
ExceptionMessage(EOFException.STACK_HEIGHT_MISMATCH, "err: stack_height_mismatch"),
)

def __init__(self) -> None:
Expand Down
4 changes: 4 additions & 0 deletions src/ethereum_test_tools/exceptions/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,10 @@ class EOFException(ExceptionBase):
"""
EOF container's code produces an stack underflow.
"""
STACK_HEIGHT_MISMATCH = auto()
"""
EOF container section stack height mismatch.
"""
MAX_STACK_HEIGHT_ABOVE_LIMIT = auto()
"""
EOF container's specified max stack height is above the limit.
Expand Down
6 changes: 0 additions & 6 deletions src/ethereum_test_tools/vm/opcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,12 +483,6 @@ def __call__(

return super().__call__(*args, unchecked=unchecked)

def __len__(self) -> int:
"""
Returns the total bytecode length of the opcode, taking into account its data portion.
"""
return self.data_portion_length + 1

def int(self) -> int:
"""
Returns the integer representation of the opcode.
Expand Down
Loading

0 comments on commit 12ceb22

Please sign in to comment.