Skip to content

Commit

Permalink
types: Add newPayload validity
Browse files Browse the repository at this point in the history
  • Loading branch information
marioevz committed Sep 21, 2023
1 parent d64bbca commit 1826382
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/ethereum_test_tools/common/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2579,6 +2579,11 @@ class FixtureEngineNewPayload:
version: int = field(
json_encoder=JSONEncoder.Field(),
)
valid: bool = field(
json_encoder=JSONEncoder.Field(
skip_string_convert=True,
),
)
error_code: Optional[EngineAPIError] = field(
default=None,
json_encoder=JSONEncoder.Field(
Expand All @@ -2594,6 +2599,7 @@ def from_fixture_header(
header: FixtureHeader,
transactions: List[Transaction],
withdrawals: Optional[List[Withdrawal]],
valid: bool,
error_code: Optional[EngineAPIError],
) -> Optional["FixtureEngineNewPayload"]:
"""
Expand All @@ -2611,6 +2617,7 @@ def from_fixture_header(
withdrawals=withdrawals,
),
version=new_payload_version,
valid=valid,
error_code=error_code,
)

Expand Down
3 changes: 2 additions & 1 deletion src/ethereum_test_tools/spec/blockchain_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ def make_block(
header=header,
transactions=txs,
withdrawals=env.withdrawals,
valid=block.exception is None,
error_code=block.engine_api_error_code,
)
if self.hive_enabled
Expand Down Expand Up @@ -259,7 +260,7 @@ def make_block(
rlp=Bytes(block.rlp),
expected_exception=block.exception,
),
fixture_payload,
None,
previous_env,
previous_alloc,
previous_head,
Expand Down
1 change: 1 addition & 0 deletions src/ethereum_test_tools/spec/state_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ def make_blocks(
header=header,
transactions=txs,
withdrawals=env.withdrawals,
valid=True,
error_code=None,
)
else:
Expand Down

0 comments on commit 1826382

Please sign in to comment.