Skip to content

Commit d35b409

Browse files
committed
bugfix: make correct attestation type across fork boundary
1 parent a626a79 commit d35b409

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
)
1212
from eth2spec.test.helpers.constants import (
1313
AFTER_DENEB_PRE_POST_FORKS,
14+
DENEB,
1415
)
1516
from eth2spec.test.helpers.state import (
1617
next_epoch_via_block,
@@ -78,7 +79,13 @@ def test_transition_attestation_from_previous_fork_with_new_range(
7879
next_epoch_via_block(spec, state)
7980

8081
# Generate an attestation for slot 0 of this epoch
81-
attestation = get_valid_attestation(spec, state, signed=True)
82+
if spec.fork == DENEB:
83+
# NOTE: attestation format changes from Deneb to Electra
84+
# so the attestation must be made with the `post_spec`
85+
target_spec = post_spec
86+
else:
87+
target_spec = spec
88+
attestation = get_valid_attestation(target_spec, state, signed=True)
8289

8390
yield 'pre', state
8491

0 commit comments

Comments
 (0)