Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a test to cover the case of is_execution_enabled result is false #2723

Merged
merged 1 commit into from
Nov 19, 2021
Merged
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
19 changes: 19 additions & 0 deletions tests/core/pyspec/eth2spec/test/merge/sanity/test_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,22 @@ def test_empty_block_transition_no_tx(spec, state):
yield 'post', state

# TODO: tests with EVM, mock or replacement?


@with_merge_and_later
@spec_state_test
def test_is_execution_enabled_false(spec, state):
# Set `latest_execution_payload_header` to empty
state.latest_execution_payload_header = spec.ExecutionPayloadHeader()
yield 'pre', state

block = build_empty_block_for_next_slot(spec, state)

# Set `execution_payload` to empty
block.body.execution_payload = spec.ExecutionPayload()
assert len(block.body.execution_payload.transactions) == 0

signed_block = state_transition_and_sign_block(spec, state, block)

yield 'blocks', [signed_block]
yield 'post', state