mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-27 02:45:28 +00:00
update test runner to handle merge phase
This commit is contained in:
parent
e2be7614cc
commit
470c6dcc6f
@ -7,7 +7,7 @@ from eth2spec.utils import bls
|
|||||||
|
|
||||||
from .exceptions import SkippedTest
|
from .exceptions import SkippedTest
|
||||||
from .helpers.constants import (
|
from .helpers.constants import (
|
||||||
PHASE0, ALTAIR,
|
PHASE0, ALTAIR, MERGE,
|
||||||
ALL_PHASES, FORKS_BEFORE_ALTAIR, FORKS_BEFORE_MERGE,
|
ALL_PHASES, FORKS_BEFORE_ALTAIR, FORKS_BEFORE_MERGE,
|
||||||
)
|
)
|
||||||
from .helpers.genesis import create_genesis_state
|
from .helpers.genesis import create_genesis_state
|
||||||
@ -312,7 +312,7 @@ def with_phases(phases, other_phases=None):
|
|||||||
return None
|
return None
|
||||||
run_phases = [phase]
|
run_phases = [phase]
|
||||||
|
|
||||||
if PHASE0 not in run_phases and ALTAIR not in run_phases:
|
if PHASE0 not in run_phases and ALTAIR not in run_phases and MERGE not in run_phases:
|
||||||
dump_skipping_message("none of the recognized phases are executable, skipping test.")
|
dump_skipping_message("none of the recognized phases are executable, skipping test.")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -331,12 +331,17 @@ def with_phases(phases, other_phases=None):
|
|||||||
if ALTAIR in available_phases:
|
if ALTAIR in available_phases:
|
||||||
phase_dir[ALTAIR] = spec_altair
|
phase_dir[ALTAIR] = spec_altair
|
||||||
|
|
||||||
|
if MERGE in available_phases:
|
||||||
|
phase_dir[MERGE] = spec_merge
|
||||||
|
|
||||||
# return is ignored whenever multiple phases are ran.
|
# return is ignored whenever multiple phases are ran.
|
||||||
# This return is for test generators to emit python generators (yielding test vector outputs)
|
# This return is for test generators to emit python generators (yielding test vector outputs)
|
||||||
if PHASE0 in run_phases:
|
if PHASE0 in run_phases:
|
||||||
ret = fn(spec=spec_phase0, phases=phase_dir, *args, **kw)
|
ret = fn(spec=spec_phase0, phases=phase_dir, *args, **kw)
|
||||||
if ALTAIR in run_phases:
|
if ALTAIR in run_phases:
|
||||||
ret = fn(spec=spec_altair, phases=phase_dir, *args, **kw)
|
ret = fn(spec=spec_altair, phases=phase_dir, *args, **kw)
|
||||||
|
if MERGE in run_phases:
|
||||||
|
ret = fn(spec=spec_merge, phases=phase_dir, *args, **kw)
|
||||||
|
|
||||||
# TODO: merge, sharding, custody_game and das are not executable yet.
|
# TODO: merge, sharding, custody_game and das are not executable yet.
|
||||||
# Tests that specify these features will not run, and get ignored for these specific phases.
|
# Tests that specify these features will not run, and get ignored for these specific phases.
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
from eth2spec.test.helpers.constants import (
|
from eth2spec.test.helpers.constants import (
|
||||||
ALTAIR,
|
ALTAIR,
|
||||||
FORKS_BEFORE_ALTAIR,
|
FORKS_BEFORE_ALTAIR,
|
||||||
|
MERGE,
|
||||||
)
|
)
|
||||||
from eth2spec.test.helpers.keys import pubkeys
|
from eth2spec.test.helpers.keys import pubkeys
|
||||||
|
|
||||||
@ -28,6 +29,8 @@ def create_genesis_state(spec, validator_balances, activation_threshold):
|
|||||||
|
|
||||||
if spec.fork == ALTAIR:
|
if spec.fork == ALTAIR:
|
||||||
current_version = spec.ALTAIR_FORK_VERSION
|
current_version = spec.ALTAIR_FORK_VERSION
|
||||||
|
elif spec.fork == MERGE:
|
||||||
|
current_version = spec.MERGE_FORK_VERSION
|
||||||
|
|
||||||
state = spec.BeaconState(
|
state = spec.BeaconState(
|
||||||
genesis_time=0,
|
genesis_time=0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user