diff --git a/Justfile b/Justfile index 01467ef46f..6484ccdc52 100644 --- a/Justfile +++ b/Justfile @@ -215,7 +215,6 @@ spec-tools *args: (_tmp "spec-tools") uv run pytest \ -n {{ xdist_workers }} \ --basetemp="{{ output_dir }}/spec-tools/tmp" \ - --ignore=tests/evm_tools/test_count_opcodes.py \ "$@" \ tests/evm_tools diff --git a/tests/evm_tools/test_count_opcodes.py b/tests/evm_tools/test_count_opcodes.py index 0ced37e51f..7d49ada223 100644 --- a/tests/evm_tools/test_count_opcodes.py +++ b/tests/evm_tools/test_count_opcodes.py @@ -6,7 +6,6 @@ import json from io import StringIO from pathlib import Path -from typing import Callable import pytest @@ -16,25 +15,27 @@ parser = create_parser() +# Fixture 3 is the only client_clis alloc with code, so the only one +# that runs opcodes. +FIXTURE = Path(__file__).parents[2] / ( + "packages/testing/src/execution_testing/client_clis/tests/fixtures/3" +) + @pytest.mark.evm_tools -def test_count_opcodes(root_relative: Callable[[str | Path], Path]) -> None: +def test_count_opcodes() -> None: """Test counting opcodes in a transaction execution using the T8N tool.""" - base_path = root_relative( - "fixtures/evm_tools_testdata/t8n/fixtures/testdata/2" - ) - options = parser.parse_args( [ "t8n", - f"--input.env={base_path / 'env.json'}", - f"--input.alloc={base_path / 'alloc.json'}", - f"--input.txs={base_path / 'txs.json'}", + f"--input.env={FIXTURE / 'env.json'}", + f"--input.alloc={FIXTURE / 'alloc.json'}", + f"--input.txs={FIXTURE / 'txs.json'}", "--output.result=stdout", "--output.body=stdout", "--output.alloc=stdout", "--opcode.count=stdout", - "--state-test", + "--state.fork=Frontier", ] ) @@ -47,10 +48,5 @@ def test_count_opcodes(root_relative: Callable[[str | Path], Path]) -> None: results = json.loads(out_file.getvalue()) - assert results["opcodeCount"] == { - "PUSH1": 5, - "MSTORE8": 1, - "CREATE": 1, - "ADD": 1, - "SELFDESTRUCT": 1, - } + # 0x600140 is PUSH1 then BLOCKHASH. + assert results["opcodeCount"] == {"PUSH1": 1, "BLOCKHASH": 1}