Skip to content

Commit

Permalink
Workarounds for EIP-7549 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ralexstokes committed Apr 16, 2024
1 parent c0fa05d commit 353bbb0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion tests/core/pyspec/eth2spec/test/helpers/fork_transition.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down

0 comments on commit 353bbb0

Please sign in to comment.