Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(ethereum_clis): move TransitionTool.verify_fixture() to StateTest and BlockTest #935

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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 @@ -56,6 +56,7 @@ Test fixtures for use by clients are available for each release on the [Github r

- ✨ Fill test fixtures using EELS by default. EEST now uses the [`ethereum-specs-evm-resolver`](https://github.com/petertdavies/ethereum-spec-evm-resolver) with the EELS daemon ([#792](https://github.com/ethereum/execution-spec-tests/pull/792)).
- πŸ”€ Move the `evm_transition_tool` package to `ethereum_clis` and derive the transition tool CL interfaces from a shared `EthereumCLI` class that can be reused for other sub-commands ([#894](https://github.com/ethereum/execution-spec-tests/pull/894)).
- πŸ”€ Refactor `ethereum_clis` and the `consume direct` interface to use `StateTest` and `Blocktest` classes called via the `FixtureConsumer` helper class ([#935](https://github.com/ethereum/execution-spec-tests/pull/935)).

### πŸ“‹ Misc

Expand Down
39 changes: 39 additions & 0 deletions src/ethereum_clis/blocktest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""
Abstract base class for `evm blocktest` subcommands.
"""

from abc import abstractmethod
from pathlib import Path
from typing import Dict, List, Optional, Type

from ethereum_test_exceptions import ExceptionMapper

from .ethereum_cli import EthereumCLI


class Blocktest(EthereumCLI):
"""
Abstract base class for `evm blocktest` subcommands.
"""

registered_tools: List[Type["Blocktest"]] = []
default_tool: Optional[Type["Blocktest"]] = None

blocktest_subcommand: Optional[str] = "blocktest"

traces: List[List[List[Dict]]] | None = None

@abstractmethod
def __init__(
self,
*,
exception_mapper: Optional[ExceptionMapper] = None,
binary: Optional[Path] = None,
trace: bool = False,
):
"""
Abstract initialization method that all subclasses must implement.
"""
self.exception_mapper = exception_mapper
super().__init__(binary=binary)
self.trace = trace
Loading