From af4725d08a2036767d6e3f208fddcc793338fc52 Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Mon, 3 Jan 2022 07:51:35 -0700 Subject: [PATCH] add some non-empty extra_data tests --- .../test_process_execution_payload.py | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/core/pyspec/eth2spec/test/bellatrix/block_processing/test_process_execution_payload.py b/tests/core/pyspec/eth2spec/test/bellatrix/block_processing/test_process_execution_payload.py index b8c5f55c3..16c759839 100644 --- a/tests/core/pyspec/eth2spec/test/bellatrix/block_processing/test_process_execution_payload.py +++ b/tests/core/pyspec/eth2spec/test/bellatrix/block_processing/test_process_execution_payload.py @@ -214,3 +214,35 @@ def test_bad_timestamp_regular_payload(spec, state): execution_payload.timestamp = execution_payload.timestamp + 1 yield from run_execution_payload_processing(spec, state, execution_payload, valid=False) + + +@with_bellatrix_and_later +@spec_state_test +def test_non_empty_extra_data_first_payload(spec, state): + # pre-state + state = build_state_with_incomplete_transition(spec, state) + next_slot(spec, state) + + # execution payload + execution_payload = build_empty_execution_payload(spec, state) + execution_payload.extra_data = b'\x45' * 12 + + yield from run_execution_payload_processing(spec, state, execution_payload) + + assert state.latest_execution_payload_header.extra_data == execution_payload.extra_data + + +@with_bellatrix_and_later +@spec_state_test +def test_non_empty_extra_data_regular_payload(spec, state): + # pre-state + state = build_state_with_complete_transition(spec, state) + next_slot(spec, state) + + # execution payload + execution_payload = build_empty_execution_payload(spec, state) + execution_payload.extra_data = b'\x45' * 12 + + yield from run_execution_payload_processing(spec, state, execution_payload) + + assert state.latest_execution_payload_header.extra_data == execution_payload.extra_data