Merge pull request #2723 from ethereum/add-test_is_execution_enabled_false

Add a test to cover the case of `is_execution_enabled` result is false
This commit is contained in:
Danny Ryan 2021-11-19 09:33:34 -07:00 committed by GitHub
commit e7df64b0a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 0 deletions

View File

@ -23,3 +23,22 @@ def test_empty_block_transition_no_tx(spec, state):
yield 'post', state yield 'post', state
# TODO: tests with EVM, mock or replacement? # 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