Skip to content

Commit 3d44dfd

Browse files
committed
Use TransitionTool.default_tool
1 parent 9f3344a commit 3d44dfd

File tree

3 files changed

+17
-163
lines changed

3 files changed

+17
-163
lines changed

src/ethereum_clis/clis/eels_t8n.py

Lines changed: 0 additions & 139 deletions
This file was deleted.

src/pytest_plugins/filler/filler.py

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
from cli.gen_index import generate_fixtures_index
2323
from config import AppConfig
2424
from ethereum_clis import TransitionTool
25-
from ethereum_clis.clis.eels_t8n import EELST8NWrapper
2625
from ethereum_clis.clis.geth import FixtureConsumerTool
2726
from ethereum_test_base_types import Account, Address, Alloc, ReferenceSpec
2827
from ethereum_test_fixtures import (
@@ -118,19 +117,12 @@ def default_html_report_file_path() -> str:
118117
def pytest_addoption(parser: pytest.Parser):
119118
"""Add command-line options to pytest."""
120119
evm_group = parser.getgroup("evm", "Arguments defining evm executable behavior")
121-
evm_group.addoption(
122-
"--eels",
123-
action="store_true",
124-
dest="eels",
125-
default=False,
126-
help="Use eels t8n entry point",
127-
)
128120
evm_group.addoption(
129121
"--evm-bin",
130122
action="store",
131123
dest="evm_bin",
132124
type=Path,
133-
default="ethereum-spec-evm-resolver",
125+
default=None,
134126
help=(
135127
"Path to an evm executable (or name of an executable in the PATH) that provides `t8n`."
136128
" Default: `ethereum-spec-evm-resolver`."
@@ -353,11 +345,13 @@ def pytest_configure(config):
353345

354346
# Instantiate the transition tool here to check that the binary path/trace option is valid.
355347
# This ensures we only raise an error once, if appropriate, instead of for every test.
356-
if config.getoption("eels", False):
357-
t8n = EELST8NWrapper.default(trace=config.getoption("evm_collect_traces"))
348+
evm_bin = config.getoption("evm_bin")
349+
if evm_bin is None:
350+
assert TransitionTool.default_tool is not None, "No default transition tool found"
351+
t8n = TransitionTool.default_tool(trace=config.getoption("evm_collect_traces"))
358352
else:
359353
t8n = TransitionTool.from_binary_path(
360-
binary_path=config.getoption("evm_bin"), trace=config.getoption("evm_collect_traces")
354+
binary_path=evm_bin, trace=config.getoption("evm_collect_traces")
361355
)
362356
if (
363357
isinstance(config.getoption("numprocesses"), int)
@@ -549,7 +543,7 @@ def pytest_html_report_title(report):
549543

550544

551545
@pytest.fixture(autouse=True, scope="session")
552-
def evm_bin(request: pytest.FixtureRequest) -> Path:
546+
def evm_bin(request: pytest.FixtureRequest) -> Path | None:
553547
"""Return configured evm tool binary path used to run t8n."""
554548
return request.config.getoption("evm_bin")
555549

@@ -564,10 +558,13 @@ def verify_fixtures_bin(request: pytest.FixtureRequest) -> Path | None:
564558

565559

566560
@pytest.fixture(autouse=True, scope="session")
567-
def t8n(request: pytest.FixtureRequest, evm_bin: Path) -> Generator[TransitionTool, None, None]:
561+
def t8n(
562+
request: pytest.FixtureRequest, evm_bin: Path | None
563+
) -> Generator[TransitionTool, None, None]:
568564
"""Return configured transition tool."""
569-
if request.config.getoption("eels"):
570-
t8n = EELST8NWrapper.default(trace=request.config.getoption("evm_collect_traces"))
565+
if evm_bin is None:
566+
assert TransitionTool.default_tool is not None, "No default transition tool found"
567+
t8n = TransitionTool.default_tool(trace=request.config.getoption("evm_collect_traces"))
571568
else:
572569
t8n = TransitionTool.from_binary_path(
573570
binary_path=evm_bin, trace=request.config.getoption("evm_collect_traces")
@@ -604,7 +601,7 @@ def do_fixture_verification(
604601
def evm_fixture_verification(
605602
request: pytest.FixtureRequest,
606603
do_fixture_verification: bool,
607-
evm_bin: Path,
604+
evm_bin: Path | None,
608605
verify_fixtures_bin: Path | None,
609606
) -> Generator[FixtureConsumer | None, None, None]:
610607
"""

src/pytest_plugins/forks/forks.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from pytest import Mark, Metafunc
1515

1616
from ethereum_clis import TransitionTool
17-
from ethereum_clis.clis.eels_t8n import EELST8NWrapper
1817
from ethereum_test_forks import (
1918
Fork,
2019
get_deployed_forks,
@@ -525,14 +524,11 @@ def get_fork_option(config, option_name: str, parameter_name: str) -> Set[Fork]:
525524
return
526525

527526
evm_bin = config.getoption("evm_bin", None)
528-
eels = config.getoption("eels", False)
529-
530-
if eels:
531-
t8n = EELST8NWrapper.default()
527+
if evm_bin is None:
528+
assert TransitionTool.default_tool is not None, "No default transition tool found"
529+
t8n = TransitionTool.default_tool()
532530
elif evm_bin is not None:
533531
t8n = TransitionTool.from_binary_path(binary_path=evm_bin)
534-
else:
535-
pytest.exit("One of --eels or --evm-bin should be specified")
536532

537533
config.unsupported_forks = frozenset( # type: ignore
538534
fork for fork in selected_fork_set if not t8n.is_fork_supported(fork)

0 commit comments

Comments
 (0)