Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Test fixtures for use by clients are available for each release on the [Github r
- ✨ Expand cases to test *CALL opcodes causing OOG ([#1703](https://github.com/ethereum/execution-specs/pull/1703)).
- ✨ Add tests for `modexp` and `ripemd` precompiled contracts ([#1691](https://github.com/ethereum/execution-specs/pull/1691)).
- ✨ Add `ecrecover` precompile tests originating form `evmone` unittests ([#1685](https://github.com/ethereum/execution-specs/pull/1685)).
- ✨ Ported tests for `ripemd` precompile going OOG for all forks ([#1732](https://github.com/ethereum/execution-specs/pull/1732)).

## [v5.3.0](https://github.com/ethereum/execution-spec-tests/releases/tag/v5.3.0) - 2025-10-09

Expand Down
13 changes: 11 additions & 2 deletions tests/frontier/precompiles/test_ripemd.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
from execution_testing.vm import Opcodes as Op


@pytest.mark.ported_from(
# The oog==True case:
[
"https://github.com/ethereum/execution-specs/blob/master/tests/static/state_tests/stPreCompiledContracts2/CallRipemd160_0Filler.json"
],
pr=["https://github.com/ethereum/execution-specs/pull/1732"],
)
@pytest.mark.valid_from("Frontier")
@pytest.mark.parametrize(
"msg, output",
Expand Down Expand Up @@ -134,12 +141,14 @@
),
],
)
@pytest.mark.parametrize("oog", [True, False])
def test_precompiles(
state_test: StateTestFiller,
pre: Alloc,
fork: Fork,
msg: bytes,
output: bytes,
oog: bool,
) -> None:
"""
Tests the behavior of `RIPEMD-160` precompiled contract.
Expand All @@ -150,7 +159,7 @@ def test_precompiles(
code=Op.CALLDATACOPY(0, 0, len(msg))
+ Op.MLOAD(0)
+ Op.CALL(
gas=50_000,
gas=50_000 if not oog else 255,
address="0x03", # RIPEMD-160 precompile address
args_offset=0,
args_size=len(msg),
Expand All @@ -170,6 +179,6 @@ def test_precompiles(
protected=fork >= Byzantium,
)

post = {account: Account(storage={0: output})}
post = {account: Account(storage={0: output if not oog else 0})}

state_test(env=env, pre=pre, post=post, tx=tx)

This file was deleted.

Loading