Skip to content
Merged
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
2 changes: 1 addition & 1 deletion docs/writing_tests/tutorials/state_transition.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ In Python, multi-line strings are denoted using `"""`. As a convention, a file's
import pytest

from ethereum_test_tools import Account, Alloc, Environment, StateTestFiller, Transaction
from ethereum_test_tools.vm.opcode import Opcodes as Op
from ethereum_test_vm import Opcodes as Op
```

In this snippet the required constants, types and helper functions are imported from `ethereum_test_tools`. The `Opcodes` class (aliased as `Op`) provides the Python minilang for writing EVM bytecode. We will go over these as we come across them.
Expand Down
6 changes: 3 additions & 3 deletions docs/writing_tests/writing_a_new_test.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ For a full list of available opcodes and their usage, see [`Opcodes`][ethereum_t

#### Higher-Level Constructs

For more complex control flow, you can use constructs like [`Switch`][ethereum_test_tools.code.generators.Switch] and [`Case`][ethereum_test_tools.code.generators.Case] from the `ethereum_test_tools.code.generators` module:
For more complex control flow, you can use constructs like [`Switch`][ethereum_test_tools.tools_code.generators.Switch] and [`Case`][ethereum_test_tools.tools_code.generators.Case] from the `ethereum_test_tools.tools_code.generators` module:

```python
from ethereum_test_tools.code.generators import Switch, Case
from ethereum_test_tools.tools_code.generators import Switch, Case
from ethereum_test_vm.opcode import Opcodes as Op

code = Switch(
Expand All @@ -191,7 +191,7 @@ code = Switch(
)
```

The `ethereum_test_tools.code.generators` module also defines other high-level constructs like [`While`][ethereum_test_tools.code.generators.While] and [`Conditional`][ethereum_test_tools.code.generators.Conditional].
The `ethereum_test_tools.tools_code.generators` module also defines other high-level constructs like [`While`][ethereum_test_tools.tools_code.generators.While] and [`Conditional`][ethereum_test_tools.tools_code.generators.Conditional].

#### Converting Bytecode to Minilang

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ line-length = 99
[tool.ruff.lint]
select = ["E", "F", "B", "W", "I", "A", "N", "D", "C"]
fixable = ["I", "B", "E", "F", "W", "D", "C"]
ignore = ["D205", "D203", "D212", "D415", "C901", "A005"]
ignore = ["D205", "D203", "D212", "D415", "C420", "C901"]

[tool.mypy]
disable_error_code = ["import-untyped"]
Expand Down
2 changes: 1 addition & 1 deletion src/cli/eest/make/templates/blockchain_test.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ from ethereum_test_tools import (
Environment,
Transaction,
)
from ethereum_test_tools.vm.opcode import Opcodes as Op
from ethereum_test_vm import Opcodes as Op

REFERENCE_SPEC_GIT_PATH = "DUMMY/eip-DUMMY.md"
REFERENCE_SPEC_VERSION = "DUMMY_VERSION"
Expand Down
2 changes: 1 addition & 1 deletion src/cli/eest/make/templates/state_test.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import pytest

from ethereum_test_forks import Fork
from ethereum_test_tools import Account, Alloc, Environment, StateTestFiller, Transaction
from ethereum_test_tools.vm.opcode import Opcodes as Op
from ethereum_test_vm import Opcodes as Op

REFERENCE_SPEC_GIT_PATH = "DUMMY/eip-DUMMY.md"
REFERENCE_SPEC_VERSION = "DUMMY_VERSION"
Expand Down
2 changes: 1 addition & 1 deletion src/cli/eofwrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from ethereum_test_types import Transaction
from ethereum_test_types.block_types import Environment
from ethereum_test_types.eof.v1 import Container
from ethereum_test_vm.bytecode import Bytecode
from ethereum_test_vm import Bytecode

from .evm_bytes import OpcodeWithOperands, process_evm_bytes

Expand Down
3 changes: 1 addition & 2 deletions src/cli/evm_bytes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
import click

from ethereum_test_base_types import ZeroPaddedHexNumber
from ethereum_test_vm import Macro
from ethereum_test_vm import Bytecode, Macro
from ethereum_test_vm import Opcodes as Op
from ethereum_test_vm.bytecode import Bytecode

OPCODES_WITH_EMPTY_LINES_AFTER = {
Op.STOP,
Expand Down
2 changes: 1 addition & 1 deletion src/cli/gentest/request_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from config import EnvConfig
from ethereum_test_base_types import Hash
from ethereum_test_rpc import BlockNumberType, DebugRPC, EthRPC
from ethereum_test_rpc.types import TransactionByHashResponse
from ethereum_test_rpc.rpc_types import TransactionByHashResponse
from ethereum_test_types import Environment


Expand Down
2 changes: 1 addition & 1 deletion src/cli/gentest/test_context_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from pydantic import BaseModel

from ethereum_test_base_types import Account, Hash
from ethereum_test_rpc.types import TransactionByHashResponse
from ethereum_test_rpc.rpc_types import TransactionByHashResponse
from ethereum_test_tools import Environment, Transaction

from .request_manager import RPCRequest
Expand Down
2 changes: 1 addition & 1 deletion src/cli/gentest/test_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from pydantic import BaseModel

from ethereum_test_base_types import Account, Address, ZeroPaddedHexNumber
from ethereum_test_rpc.types import TransactionByHashResponse
from ethereum_test_rpc.rpc_types import TransactionByHashResponse
from ethereum_test_types import Environment


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ addopts =
-p pytest_plugins.concurrency
# disable pytest built-in logging entirely `-p no:logging`
-p no:logging
-p pytest_plugins.logging.logging
-p pytest_plugins.custom_logging.plugin_logging
-p pytest_plugins.consume.consume
-p pytest_plugins.help.help
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ python_files = *.py
addopts =
-p pytest_plugins.execute.eth_config.eth_config
-p pytest_plugins.help.help
-p pytest_plugins.logging.logging
-p pytest_plugins.custom_logging.plugin_logging
-m "not eip_version_check"
--tb short
--dist loadscope
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ addopts =
-p pytest_plugins.execute.rpc.remote
-p pytest_plugins.forks.forks
-p pytest_plugins.help.help
-p pytest_plugins.logging.logging
-p pytest_plugins.custom_logging.plugin_logging
--tb short
--dist loadscope
--ignore tests/cancun/eip4844_blobs/point_evaluation_vectors/
2 changes: 1 addition & 1 deletion src/cli/pytest_commands/pytest_ini_files/pytest-fill.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ addopts =
-p pytest_plugins.forks.forks
-p pytest_plugins.eels_resolver
-p pytest_plugins.help.help
-p pytest_plugins.logging.logging
-p pytest_plugins.custom_logging.plugin_logging
--tb short
--ignore tests/cancun/eip4844_blobs/point_evaluation_vectors/
# these customizations require the pytest-custom-report plugin
Expand Down
14 changes: 7 additions & 7 deletions src/ethereum_clis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
"""Library of Python wrappers for the different implementations of transition tools."""

from .cli_types import (
BlockExceptionWithMessage,
Result,
Traces,
TransactionExceptionWithMessage,
TransitionToolOutput,
)
from .clis.besu import BesuTransitionTool
from .clis.ethereumjs import EthereumJSTransitionTool
from .clis.evmone import EvmoneExceptionMapper, EvmOneTransitionTool
Expand All @@ -10,13 +17,6 @@
from .ethereum_cli import CLINotFoundInPathError, UnknownCLIError
from .fixture_consumer_tool import FixtureConsumerTool
from .transition_tool import TransitionTool
from .types import (
BlockExceptionWithMessage,
Result,
Traces,
TransactionExceptionWithMessage,
TransitionToolOutput,
)

TransitionTool.set_default_tool(ExecutionSpecsTransitionTool)
FixtureConsumerTool.set_default_tool(GethFixtureConsumer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
Transaction,
TransactionReceipt,
)
from pytest_plugins.logging import get_logger
from pytest_plugins.custom_logging import get_logger

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion src/ethereum_clis/clis/besu.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
)
from ethereum_test_forks import Fork

from ..cli_types import TransitionToolOutput
from ..transition_tool import TransitionTool, dump_files_to_directory, model_dump_config
from ..types import TransitionToolOutput


class BesuTransitionTool(TransitionTool):
Expand Down
2 changes: 1 addition & 1 deletion src/ethereum_clis/clis/execution_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
TransactionException,
)
from ethereum_test_forks import Fork
from pytest_plugins.logging import get_logger
from pytest_plugins.custom_logging import get_logger

from ..transition_tool import TransitionTool

Expand Down
2 changes: 1 addition & 1 deletion src/ethereum_clis/ethereum_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from re import Pattern
from typing import Any, List, Optional, Type

from pytest_plugins.logging import get_logger
from pytest_plugins.custom_logging import get_logger

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion src/ethereum_clis/tests/test_transition_tools_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
Withdrawal,
add_kzg_version,
)
from ethereum_test_tools.vm.opcode import Opcodes as Op
from ethereum_test_types import Alloc
from ethereum_test_vm import Opcodes as Op

BLOB_COMMITMENT_VERSION_KZG = 1

Expand Down
6 changes: 3 additions & 3 deletions src/ethereum_clis/transition_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
from ethereum_test_forks.helpers import get_development_forks, get_forks
from ethereum_test_types import Alloc, Environment, Transaction

from .ethereum_cli import EthereumCLI
from .file_utils import dump_files_to_directory, write_json_file
from .types import (
from .cli_types import (
Traces,
TransactionReceipt,
TransactionTraces,
Expand All @@ -35,6 +33,8 @@
TransitionToolOutput,
TransitionToolRequest,
)
from .ethereum_cli import EthereumCLI
from .file_utils import dump_files_to_directory, write_json_file

model_dump_config: Mapping = {"by_alias": True, "exclude_none": True}

Expand Down
2 changes: 1 addition & 1 deletion src/ethereum_test_base_types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
Wei,
ZeroPaddedHexNumber,
)
from .base_types_json import to_json
from .composite_types import (
AccessList,
Account,
Expand All @@ -38,7 +39,6 @@
TestPrivateKey2,
)
from .conversions import to_bytes, to_hex
from .json import to_json
from .pydantic import CamelModel, EthereumTestBaseModel, EthereumTestRootModel
from .reference_spec import ReferenceSpec
from .serialization import RLPSerializable, SignableRLPSerializable
Expand Down
2 changes: 1 addition & 1 deletion src/ethereum_test_base_types/tests/test_base_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import pytest

from ..base_types import Address, Hash, Wei
from ..base_types_json import to_json
from ..composite_types import AccessList
from ..json import to_json


@pytest.mark.parametrize(
Expand Down
4 changes: 2 additions & 2 deletions src/ethereum_test_exceptions/exceptions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
from .base import ExceptionBase, UndefinedException, from_pipe_str, to_pipe_str
from .block import BlockException
from .eof import EOFException
from .transaction import TransactionException
from .types import (
from .exceptions_types import (
BlockExceptionInstanceOrList,
EOFExceptionInstanceOrList,
ExceptionBoundTypeVar,
ExceptionInstanceOrList,
TransactionExceptionInstanceOrList,
)
from .transaction import TransactionException

__all__ = [
"ExceptionBase",
Expand Down
4 changes: 2 additions & 2 deletions src/ethereum_test_execution/blob_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
from ethereum_test_base_types.base_types import Bytes
from ethereum_test_forks import Fork
from ethereum_test_rpc import BlobAndProofV1, BlobAndProofV2, EngineRPC, EthRPC
from ethereum_test_rpc.types import GetBlobsResponse
from ethereum_test_rpc.rpc_types import GetBlobsResponse
from ethereum_test_types import NetworkWrappedTransaction, Transaction
from ethereum_test_types.transaction_types import TransactionTestMetadata
from pytest_plugins.logging import get_logger
from pytest_plugins.custom_logging import get_logger

from .base import BaseExecute

Expand Down
2 changes: 1 addition & 1 deletion src/ethereum_test_rpc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
NetRPC,
SendTransactionExceptionError,
)
from .types import (
from .rpc_types import (
BlobAndProofV1,
BlobAndProofV2,
EthConfigResponse,
Expand Down
4 changes: 2 additions & 2 deletions src/ethereum_test_rpc/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

from ethereum_test_base_types import Address, Bytes, Hash, to_json
from ethereum_test_types import Transaction
from pytest_plugins.logging import get_logger
from pytest_plugins.custom_logging import get_logger

from .types import (
from .rpc_types import (
EthConfigResponse,
ForkchoiceState,
ForkchoiceUpdateResponse,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/ethereum_test_specs/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
Environment,
Transaction,
)
from pytest_plugins.logging import get_logger
from pytest_plugins.custom_logging import get_logger

from .base import BaseTest, OpMode
from .blockchain import Block, BlockchainTest, Header
Expand Down
2 changes: 1 addition & 1 deletion src/ethereum_test_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
call_return_code,
)

from .code import (
from .tools_code import (
CalldataCase,
Case,
CodeGasMeasure,
Expand Down
2 changes: 1 addition & 1 deletion src/ethereum_test_tools/tests/test_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from ethereum_test_vm import UndefinedOpcodes
from pytest_plugins.solc.solc import SOLC_EXPECTED_MIN_VERSION

from ..code import CalldataCase, Case, Conditional, Initcode, Switch
from ..tools_code import CalldataCase, Case, Conditional, Initcode, Switch


@pytest.fixture(params=get_deployed_forks())
Expand Down
13 changes: 0 additions & 13 deletions src/ethereum_test_tools/vm/__init__.py

This file was deleted.

21 changes: 0 additions & 21 deletions src/ethereum_test_tools/vm/opcode.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/ethereum_test_types/blob_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from ethereum_test_base_types.base_types import Bytes, Hash
from ethereum_test_base_types.pydantic import CamelModel
from ethereum_test_forks import Fork
from pytest_plugins.logging import get_logger
from pytest_plugins.custom_logging import get_logger

CACHED_BLOBS_DIRECTORY: Path = (
Path(platformdirs.user_cache_dir("ethereum-execution-spec-tests")) / "cached_blobs"
Expand Down
2 changes: 1 addition & 1 deletion src/ethereum_test_types/transaction_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
TestPrivateKey,
)
from ethereum_test_exceptions import TransactionException
from pytest_plugins.logging import get_logger
from pytest_plugins.custom_logging import get_logger

from .account_types import EOA
from .blob_types import Blob
Expand Down
Loading
Loading