Skip to content

Commit 353bbb0

Browse files
committed
Workarounds for EIP-7549 tests
1 parent c0fa05d commit 353bbb0

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

tests/core/pyspec/eth2spec/test/deneb/transition/test_operations.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,12 @@ def test_transition_attestation_from_previous_fork_with_new_range(
8383
# NOTE: attestation format changes from Deneb to Electra
8484
# so the attestation must be made with the `post_spec`
8585
target_spec = post_spec
86+
target_state = post_spec.upgrade_to_electra(state.copy())
87+
target_state.fork = state.fork
8688
else:
8789
target_spec = spec
88-
attestation = get_valid_attestation(target_spec, state, signed=True)
90+
target_state = state
91+
attestation = get_valid_attestation(target_spec, target_state, signed=True)
8992

9093
yield 'pre', state
9194

tests/core/pyspec/eth2spec/test/helpers/fork_transition.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,14 @@ def run_transition_with_operation(state,
302302
# NOTE: attestation format changes between Deneb and Electra
303303
# so attester slashing must be made with the `post_spec`
304304
target_spec = post_spec
305+
target_state = post_spec.upgrade_to_electra(state.copy())
306+
target_state.fork = state.fork
305307
else:
306308
target_spec = spec
309+
target_state = state
307310

308311
attester_slashing = get_valid_attester_slashing_by_indices(
309-
target_spec, state,
312+
target_spec, target_state,
310313
[selected_validator_index],
311314
signed_1=True, signed_2=True,
312315
)

0 commit comments

Comments
 (0)