From 353bbb02a6d19352d28019558bac8fb8d2763129 Mon Sep 17 00:00:00 2001 From: Alex Stokes Date: Mon, 15 Apr 2024 21:50:43 -0600 Subject: [PATCH] Workarounds for EIP-7549 tests --- .../pyspec/eth2spec/test/deneb/transition/test_operations.py | 5 ++++- tests/core/pyspec/eth2spec/test/helpers/fork_transition.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/core/pyspec/eth2spec/test/deneb/transition/test_operations.py b/tests/core/pyspec/eth2spec/test/deneb/transition/test_operations.py index 67ae50129b..748117a616 100644 --- a/tests/core/pyspec/eth2spec/test/deneb/transition/test_operations.py +++ b/tests/core/pyspec/eth2spec/test/deneb/transition/test_operations.py @@ -83,9 +83,12 @@ def test_transition_attestation_from_previous_fork_with_new_range( # NOTE: attestation format changes from Deneb to Electra # so the attestation must be made with the `post_spec` target_spec = post_spec + target_state = post_spec.upgrade_to_electra(state.copy()) + target_state.fork = state.fork else: target_spec = spec - attestation = get_valid_attestation(target_spec, state, signed=True) + target_state = state + attestation = get_valid_attestation(target_spec, target_state, signed=True) yield 'pre', state diff --git a/tests/core/pyspec/eth2spec/test/helpers/fork_transition.py b/tests/core/pyspec/eth2spec/test/helpers/fork_transition.py index 551636c5f7..8eb72fdad5 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/fork_transition.py +++ b/tests/core/pyspec/eth2spec/test/helpers/fork_transition.py @@ -302,11 +302,14 @@ def run_transition_with_operation(state, # NOTE: attestation format changes between Deneb and Electra # so attester slashing must be made with the `post_spec` target_spec = post_spec + target_state = post_spec.upgrade_to_electra(state.copy()) + target_state.fork = state.fork else: target_spec = spec + target_state = state attester_slashing = get_valid_attester_slashing_by_indices( - target_spec, state, + target_spec, target_state, [selected_validator_index], signed_1=True, signed_2=True, )