Skip to content

Commit

Permalink
all: Abstract fixtures, StateTest refactor (#354)
Browse files Browse the repository at this point in the history
* all: abstract fixtures, convert StateTest into a BlockchainTest generator

* fix: tox
  • Loading branch information
marioevz authored Dec 7, 2023
1 parent 23fe412 commit 4dc7364
Show file tree
Hide file tree
Showing 20 changed files with 1,321 additions and 1,411 deletions.
10 changes: 3 additions & 7 deletions src/ethereum_test_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,9 @@
AccessList,
Account,
Auto,
Block,
EngineAPIError,
Environment,
Fixture,
FixtureEngineNewPayload,
Header,
HistoryStorageAddress,
HiveFixture,
JSONEncoder,
Removable,
Storage,
Expand All @@ -46,22 +41,24 @@
to_hash,
to_hash_bytes,
)
from .filling.fill import fill_test
from .reference_spec import ReferenceSpec, ReferenceSpecTypes
from .spec import (
BaseFixture,
BaseTest,
BaseTestConfig,
BlockchainTest,
BlockchainTestFiller,
StateTest,
StateTestFiller,
)
from .spec.blockchain.types import Block, Header
from .vm import Opcode, OpcodeCallArg, Opcodes

__all__ = (
"AccessList",
"Account",
"Auto",
"BaseFixture",
"BaseTest",
"BaseTestConfig",
"Block",
Expand Down Expand Up @@ -107,7 +104,6 @@
"cost_memory_bytes",
"eip_2028_transaction_data_cost",
"eip_2028_transaction_data_cost",
"fill_test",
"to_address",
"to_hash_bytes",
"to_hash",
Expand Down
18 changes: 1 addition & 17 deletions src/ethereum_test_tools/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,18 @@
to_hash,
to_hash_bytes,
)
from .json import to_json
from .types import (
AccessList,
Account,
Address,
Alloc,
Auto,
Block,
Bloom,
Bytes,
Environment,
Fixture,
FixtureBlock,
FixtureEngineNewPayload,
FixtureHeader,
Hash,
Header,
HeaderNonce,
HiveFixture,
InvalidFixtureBlock,
JSONEncoder,
Number,
Removable,
Expand All @@ -53,7 +46,6 @@
alloc_to_accounts,
serialize_transactions,
str_or_none,
to_json,
withdrawals_root,
)

Expand All @@ -65,22 +57,14 @@
"AddrBB",
"Alloc",
"Auto",
"Block",
"Bloom",
"Bytes",
"EngineAPIError",
"EmptyTrieRoot",
"Environment",
"Fixture",
"FixtureBlock",
"FixtureEngineNewPayload",
"FixtureHeader",
"Hash",
"Header",
"HeaderNonce",
"HistoryStorageAddress",
"HiveFixture",
"InvalidFixtureBlock",
"JSONEncoder",
"Number",
"Removable",
Expand Down
Loading

0 comments on commit 4dc7364

Please sign in to comment.