Skip to content

Commit e71f2ea

Browse files
marioevzchfast
andcommitted
feat(fw): set deploy_tx on ContainerKind.INITCODE
Co-authored-by: Paweł Bylica <[email protected]>
1 parent 7c48de9 commit e71f2ea

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/ethereum_test_tools/spec/eof/eof_test.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,26 @@ class EOFStateTest(EOFTest):
295295
FixtureFormats.BLOCKCHAIN_TEST_HIVE,
296296
]
297297

298+
@model_validator(mode="before")
299+
@classmethod
300+
def check_container_type(cls, data: Any) -> Any:
301+
"""
302+
Check if the container exception matches the expected exception.
303+
"""
304+
if isinstance(data, dict):
305+
container = data.get("data")
306+
deploy_tx = data.get("deploy_tx")
307+
container_kind = data.get("container_kind")
308+
if deploy_tx is None:
309+
if (
310+
container is not None
311+
and isinstance(container, Container)
312+
and "kind" in container.model_fields_set
313+
and container.kind == ContainerKind.INITCODE
314+
) or (container_kind is not None and container_kind == ContainerKind.INITCODE):
315+
data["deploy_tx"] = True
316+
return data
317+
298318
@classmethod
299319
def pytest_parameter_name(cls) -> str:
300320
"""

0 commit comments

Comments
 (0)