Skip to content

Commit cf2cf3e

Browse files
committed
all: Abstract fixtures, StateTest refactor (#354)
* all: abstract fixtures, convert StateTest into a BlockchainTest generator * fix: tox
1 parent 51d30bd commit cf2cf3e

20 files changed

+1321
-1425
lines changed

src/ethereum_test_tools/__init__.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,9 @@
1818
AccessList,
1919
Account,
2020
Auto,
21-
Block,
2221
EngineAPIError,
2322
Environment,
24-
Fixture,
25-
FixtureEngineNewPayload,
26-
Header,
2723
HistoryStorageAddress,
28-
HiveFixture,
2924
JSONEncoder,
3025
Removable,
3126
Storage,
@@ -47,22 +42,24 @@
4742
to_hash_bytes,
4843
transaction_list_root,
4944
)
50-
from .filling.fill import fill_test
5145
from .reference_spec import ReferenceSpec, ReferenceSpecTypes
5246
from .spec import (
47+
BaseFixture,
5348
BaseTest,
5449
BaseTestConfig,
5550
BlockchainTest,
5651
BlockchainTestFiller,
5752
StateTest,
5853
StateTestFiller,
5954
)
55+
from .spec.blockchain.types import Block, Header
6056
from .vm import Opcode, OpcodeCallArg, Opcodes
6157

6258
__all__ = (
6359
"AccessList",
6460
"Account",
6561
"Auto",
62+
"BaseFixture",
6663
"BaseTest",
6764
"BaseTestConfig",
6865
"Block",
@@ -108,7 +105,6 @@
108105
"cost_memory_bytes",
109106
"eip_2028_transaction_data_cost",
110107
"eip_2028_transaction_data_cost",
111-
"fill_test",
112108
"to_address",
113109
"to_hash_bytes",
114110
"to_hash",

src/ethereum_test_tools/common/__init__.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,18 @@
2424
to_hash,
2525
to_hash_bytes,
2626
)
27+
from .json import to_json
2728
from .types import (
2829
AccessList,
2930
Account,
3031
Address,
3132
Alloc,
3233
Auto,
33-
Block,
3434
Bloom,
3535
Bytes,
3636
Environment,
37-
Fixture,
38-
FixtureBlock,
39-
FixtureEngineNewPayload,
40-
FixtureHeader,
4137
Hash,
42-
Header,
4338
HeaderNonce,
44-
HiveFixture,
45-
InvalidFixtureBlock,
4639
JSONEncoder,
4740
Number,
4841
Removable,
@@ -53,7 +46,6 @@
5346
alloc_to_accounts,
5447
serialize_transactions,
5548
str_or_none,
56-
to_json,
5749
transaction_list_root,
5850
withdrawals_root,
5951
)
@@ -66,22 +58,14 @@
6658
"AddrBB",
6759
"Alloc",
6860
"Auto",
69-
"Block",
7061
"Bloom",
7162
"Bytes",
7263
"EngineAPIError",
7364
"EmptyTrieRoot",
7465
"Environment",
75-
"Fixture",
76-
"FixtureBlock",
77-
"FixtureEngineNewPayload",
78-
"FixtureHeader",
7966
"Hash",
80-
"Header",
8167
"HeaderNonce",
8268
"HistoryStorageAddress",
83-
"HiveFixture",
84-
"InvalidFixtureBlock",
8569
"JSONEncoder",
8670
"Number",
8771
"Removable",

0 commit comments

Comments
 (0)