Fix `test_override_config_fork_epoch`

This commit is contained in:
Hsiao-Wei Wang 2022-07-16 01:28:19 +08:00
parent ec980dae4c
commit 5356fee282
No known key found for this signature in database
GPG Key ID: AE3D6B174F971DE4
2 changed files with 16 additions and 4 deletions

View File

@ -1,8 +1,10 @@
from eth2spec.test.context import (
is_post_capella,
is_post_eip4844,
spec_configured_state_test,
spec_state_test_with_matching_config,
with_all_phases,
with_phases
with_phases,
)
from eth2spec.test.helpers.constants import ALTAIR
@ -38,9 +40,15 @@ def test_override_config_fork_epoch(spec, state):
if state.fork.current_version == spec.config.BELLATRIX_FORK_VERSION:
return
assert spec.config.CAPELLA_FORK_EPOCH == spec.GENESIS_EPOCH
if state.fork.current_version == spec.config.CAPELLA_FORK_VERSION:
return
if is_post_capella(spec):
assert spec.config.CAPELLA_FORK_EPOCH == spec.GENESIS_EPOCH
if state.fork.current_version == spec.config.CAPELLA_FORK_VERSION:
return
if is_post_eip4844(spec):
assert spec.config.EIP4844_FORK_EPOCH == spec.GENESIS_EPOCH
if state.fork.current_version == spec.config.EIP4844_FORK_VERSION:
return
assert spec.config.SHARDING_FORK_EPOCH == spec.GENESIS_EPOCH
if state.fork.current_version == spec.config.SHARDING_FORK_VERSION:

View File

@ -596,6 +596,10 @@ def is_post_capella(spec):
return spec.fork == CAPELLA
def is_post_eip4844(spec):
return spec.fork == EIP4844
with_altair_and_later = with_all_phases_except([PHASE0])
with_bellatrix_and_later = with_all_phases_except([PHASE0, ALTAIR])
with_capella_and_later = with_all_phases_except([PHASE0, ALTAIR, BELLATRIX, EIP4844])