Workarounds for EIP-7549 tests

This commit is contained in:
Alex Stokes 2024-04-15 21:50:43 -06:00
parent c0fa05de1e
commit 353bbb02a6
No known key found for this signature in database
2 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -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,
)