diff --git a/tests/core/pyspec/eth2spec/test/altair/unittests/test_config_override.py b/tests/core/pyspec/eth2spec/test/altair/unittests/test_config_override.py index e3836d3c9..5448781ec 100644 --- a/tests/core/pyspec/eth2spec/test/altair/unittests/test_config_override.py +++ b/tests/core/pyspec/eth2spec/test/altair/unittests/test_config_override.py @@ -5,7 +5,7 @@ from eth2spec.test.context import ( with_phases, ) from eth2spec.test.helpers.constants import ALTAIR -from eth2spec.test.helpers.phases import ( +from eth2spec.test.helpers.forks import ( is_post_capella, is_post_eip4844, ) diff --git a/tests/core/pyspec/eth2spec/test/context.py b/tests/core/pyspec/eth2spec/test/context.py index 7684e74be..920b97f31 100644 --- a/tests/core/pyspec/eth2spec/test/context.py +++ b/tests/core/pyspec/eth2spec/test/context.py @@ -16,7 +16,7 @@ from .helpers.constants import ( ALL_PHASES, ALL_FORK_UPGRADES, ) -from .helpers.phases import is_post_fork +from .helpers.forks import is_post_fork from .helpers.typing import SpecForkName, PresetBaseName from .helpers.genesis import create_genesis_state from .utils import ( diff --git a/tests/core/pyspec/eth2spec/test/helpers/attestations.py b/tests/core/pyspec/eth2spec/test/helpers/attestations.py index c3db16675..a636adace 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/attestations.py +++ b/tests/core/pyspec/eth2spec/test/helpers/attestations.py @@ -5,8 +5,8 @@ from typing import List from eth2spec.test.context import expect_assertion_error from eth2spec.test.helpers.state import state_transition_and_sign_block, next_epoch, next_slot from eth2spec.test.helpers.block import build_empty_block_for_next_slot +from eth2spec.test.helpers.forks import is_post_altair from eth2spec.test.helpers.keys import privkeys -from eth2spec.test.helpers.phases import is_post_altair from eth2spec.utils import bls from eth2spec.utils.ssz.ssz_typing import Bitlist diff --git a/tests/core/pyspec/eth2spec/test/helpers/block.py b/tests/core/pyspec/eth2spec/test/helpers/block.py index 24bc68e60..270bc4be1 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/block.py +++ b/tests/core/pyspec/eth2spec/test/helpers/block.py @@ -1,6 +1,6 @@ from eth2spec.test.helpers.execution_payload import build_empty_execution_payload +from eth2spec.test.helpers.forks import is_post_altair, is_post_bellatrix from eth2spec.test.helpers.keys import privkeys -from eth2spec.test.helpers.phases import is_post_altair, is_post_bellatrix from eth2spec.utils import bls from eth2spec.utils.bls import only_with_bls from eth2spec.utils.ssz.ssz_impl import hash_tree_root diff --git a/tests/core/pyspec/eth2spec/test/helpers/deposits.py b/tests/core/pyspec/eth2spec/test/helpers/deposits.py index f013fdc7e..f8ab75e85 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/deposits.py +++ b/tests/core/pyspec/eth2spec/test/helpers/deposits.py @@ -1,8 +1,8 @@ from random import Random from eth2spec.test.context import expect_assertion_error +from eth2spec.test.helpers.forks import is_post_altair from eth2spec.test.helpers.keys import pubkeys, privkeys -from eth2spec.test.helpers.phases import is_post_altair from eth2spec.test.helpers.state import get_balance from eth2spec.utils import bls from eth2spec.utils.merkle_minimal import calc_merkle_tree_from_leaves, get_merkle_proof diff --git a/tests/core/pyspec/eth2spec/test/helpers/epoch_processing.py b/tests/core/pyspec/eth2spec/test/helpers/epoch_processing.py index ebfce5cad..ed61f8bdb 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/epoch_processing.py +++ b/tests/core/pyspec/eth2spec/test/helpers/epoch_processing.py @@ -1,5 +1,5 @@ -from eth2spec.test.helpers.phases import is_post_altair +from eth2spec.test.helpers.forks import is_post_altair def get_process_calls(spec): diff --git a/tests/core/pyspec/eth2spec/test/helpers/execution_payload.py b/tests/core/pyspec/eth2spec/test/helpers/execution_payload.py index f2dd15e39..b745d80c8 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/execution_payload.py +++ b/tests/core/pyspec/eth2spec/test/helpers/execution_payload.py @@ -1,5 +1,5 @@ from eth2spec.debug.random_value import get_random_bytes_list -from eth2spec.test.helpers.phases import is_post_capella +from eth2spec.test.helpers.forks import is_post_capella def build_empty_execution_payload(spec, state, randao_mix=None): diff --git a/tests/core/pyspec/eth2spec/test/helpers/phases.py b/tests/core/pyspec/eth2spec/test/helpers/forks.py similarity index 93% rename from tests/core/pyspec/eth2spec/test/helpers/phases.py rename to tests/core/pyspec/eth2spec/test/helpers/forks.py index 4bb75413d..d6d88876a 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/phases.py +++ b/tests/core/pyspec/eth2spec/test/helpers/forks.py @@ -14,7 +14,7 @@ def is_post_fork(a, b): return b in [PHASE0, ALTAIR] if a == PHASE0: return b in [PHASE0] - assert False # Fork is missing + raise ValueError("Unknown fork name %s" % a) def is_post_altair(spec): diff --git a/tests/core/pyspec/eth2spec/test/helpers/genesis.py b/tests/core/pyspec/eth2spec/test/helpers/genesis.py index bd4f0e421..ee3068788 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/genesis.py +++ b/tests/core/pyspec/eth2spec/test/helpers/genesis.py @@ -1,7 +1,7 @@ from eth2spec.test.helpers.constants import ( ALTAIR, BELLATRIX, CAPELLA, EIP4844, ) -from eth2spec.test.helpers.phases import ( +from eth2spec.test.helpers.forks import ( is_post_altair, is_post_bellatrix, ) from eth2spec.test.helpers.keys import pubkeys diff --git a/tests/core/pyspec/eth2spec/test/helpers/proposer_slashings.py b/tests/core/pyspec/eth2spec/test/helpers/proposer_slashings.py index abb8bd62a..329188829 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/proposer_slashings.py +++ b/tests/core/pyspec/eth2spec/test/helpers/proposer_slashings.py @@ -1,6 +1,6 @@ from eth2spec.test.helpers.block_header import sign_block_header +from eth2spec.test.helpers.forks import is_post_altair, is_post_bellatrix from eth2spec.test.helpers.keys import pubkey_to_privkey -from eth2spec.test.helpers.phases import is_post_altair, is_post_bellatrix from eth2spec.test.helpers.state import get_balance from eth2spec.test.helpers.sync_committee import ( compute_committee_indices, diff --git a/tests/core/pyspec/eth2spec/test/helpers/random.py b/tests/core/pyspec/eth2spec/test/helpers/random.py index 1b093fb41..eb280076f 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/random.py +++ b/tests/core/pyspec/eth2spec/test/helpers/random.py @@ -2,7 +2,7 @@ from random import Random from eth2spec.test.helpers.attestations import cached_prepare_state_with_attestations from eth2spec.test.helpers.deposits import mock_deposit -from eth2spec.test.helpers.phases import is_post_altair +from eth2spec.test.helpers.forks import is_post_altair from eth2spec.test.helpers.state import next_epoch diff --git a/tests/core/pyspec/eth2spec/test/helpers/rewards.py b/tests/core/pyspec/eth2spec/test/helpers/rewards.py index c3a5cf2a9..4168c2490 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/rewards.py +++ b/tests/core/pyspec/eth2spec/test/helpers/rewards.py @@ -2,7 +2,7 @@ from random import Random from lru import LRU from eth2spec.phase0.mainnet import VALIDATOR_REGISTRY_LIMIT # equal everywhere, fine to import -from eth2spec.test.helpers.phases import is_post_altair, is_post_bellatrix +from eth2spec.test.helpers.forks import is_post_altair, is_post_bellatrix from eth2spec.test.helpers.state import ( next_epoch, ) diff --git a/tests/core/pyspec/eth2spec/test/helpers/state.py b/tests/core/pyspec/eth2spec/test/helpers/state.py index 2190f1759..0dc17b00f 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/state.py +++ b/tests/core/pyspec/eth2spec/test/helpers/state.py @@ -1,6 +1,6 @@ from eth2spec.test.context import expect_assertion_error from eth2spec.test.helpers.block import apply_empty_block, sign_block, transition_unsigned_block -from eth2spec.test.helpers.phases import is_post_altair +from eth2spec.test.helpers.forks import is_post_altair from eth2spec.test.helpers.voluntary_exits import get_unslashed_exited_validators diff --git a/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_justification_and_finalization.py b/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_justification_and_finalization.py index c94d3e757..dba0442cb 100644 --- a/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_justification_and_finalization.py +++ b/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_justification_and_finalization.py @@ -3,7 +3,7 @@ from eth2spec.test.context import spec_state_test, with_all_phases from eth2spec.test.helpers.epoch_processing import ( run_epoch_processing_with, ) -from eth2spec.test.helpers.phases import is_post_altair +from eth2spec.test.helpers.forks import is_post_altair from eth2spec.test.helpers.state import transition_to, next_epoch_via_block, next_slot from eth2spec.test.helpers.voluntary_exits import get_unslashed_exited_validators diff --git a/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_rewards_and_penalties.py b/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_rewards_and_penalties.py index 443aa0c3c..e3c01f263 100644 --- a/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_rewards_and_penalties.py +++ b/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_rewards_and_penalties.py @@ -6,7 +6,7 @@ from eth2spec.test.context import ( zero_activation_threshold, misc_balances, low_single_balance, ) -from eth2spec.test.helpers.phases import ( +from eth2spec.test.helpers.forks import ( is_post_altair, ) from eth2spec.test.helpers.state import ( diff --git a/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_slashings.py b/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_slashings.py index 7ad487fae..172243077 100644 --- a/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_slashings.py +++ b/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_slashings.py @@ -3,8 +3,8 @@ from eth2spec.test.context import spec_state_test, with_all_phases from eth2spec.test.helpers.epoch_processing import ( run_epoch_processing_with, run_epoch_processing_to ) +from eth2spec.test.helpers.forks import is_post_altair, is_post_bellatrix from eth2spec.test.helpers.random import randomize_state -from eth2spec.test.helpers.phases import is_post_altair, is_post_bellatrix from eth2spec.test.helpers.state import has_active_balance_differential from eth2spec.test.helpers.voluntary_exits import get_unslashed_exited_validators from eth2spec.test.helpers.state import next_epoch diff --git a/tests/core/pyspec/eth2spec/test/phase0/fork_choice/test_get_head.py b/tests/core/pyspec/eth2spec/test/phase0/fork_choice/test_get_head.py index 286bd06e5..990c42031 100644 --- a/tests/core/pyspec/eth2spec/test/phase0/fork_choice/test_get_head.py +++ b/tests/core/pyspec/eth2spec/test/phase0/fork_choice/test_get_head.py @@ -23,7 +23,7 @@ from eth2spec.test.helpers.fork_choice import ( tick_and_run_on_attestation, tick_and_add_block, ) -from eth2spec.test.helpers.phases import ( +from eth2spec.test.helpers.forks import ( is_post_altair, ) from eth2spec.test.helpers.state import ( diff --git a/tests/core/pyspec/eth2spec/test/phase0/genesis/test_initialization.py b/tests/core/pyspec/eth2spec/test/phase0/genesis/test_initialization.py index f311ec127..4c7c5f28c 100644 --- a/tests/core/pyspec/eth2spec/test/phase0/genesis/test_initialization.py +++ b/tests/core/pyspec/eth2spec/test/phase0/genesis/test_initialization.py @@ -9,7 +9,7 @@ from eth2spec.test.helpers.deposits import ( prepare_full_genesis_deposits, prepare_random_genesis_deposits, ) -from eth2spec.test.helpers.phases import ( +from eth2spec.test.helpers.forks import ( is_post_altair, ) diff --git a/tests/core/pyspec/eth2spec/test/phase0/genesis/test_validity.py b/tests/core/pyspec/eth2spec/test/phase0/genesis/test_validity.py index e0e64875d..aecc96077 100644 --- a/tests/core/pyspec/eth2spec/test/phase0/genesis/test_validity.py +++ b/tests/core/pyspec/eth2spec/test/phase0/genesis/test_validity.py @@ -8,7 +8,7 @@ from eth2spec.test.helpers.constants import MINIMAL from eth2spec.test.helpers.deposits import ( prepare_full_genesis_deposits, ) -from eth2spec.test.helpers.phases import ( +from eth2spec.test.helpers.forks import ( is_post_altair, ) diff --git a/tests/core/pyspec/eth2spec/test/phase0/sanity/test_blocks.py b/tests/core/pyspec/eth2spec/test/phase0/sanity/test_blocks.py index 57ae90093..b94a01f7f 100644 --- a/tests/core/pyspec/eth2spec/test/phase0/sanity/test_blocks.py +++ b/tests/core/pyspec/eth2spec/test/phase0/sanity/test_blocks.py @@ -30,7 +30,7 @@ from eth2spec.test.helpers.sync_committee import ( compute_sync_committee_participant_reward_and_penalty, ) from eth2spec.test.helpers.constants import PHASE0, MINIMAL -from eth2spec.test.helpers.phases import is_post_altair, is_post_bellatrix +from eth2spec.test.helpers.forks import is_post_altair, is_post_bellatrix from eth2spec.test.context import ( spec_test, spec_state_test, dump_skipping_message, with_phases, with_all_phases, single_phase, diff --git a/tests/core/pyspec/eth2spec/test/phase0/unittests/test_config_invariants.py b/tests/core/pyspec/eth2spec/test/phase0/unittests/test_config_invariants.py index f33a2802b..9b27d1deb 100644 --- a/tests/core/pyspec/eth2spec/test/phase0/unittests/test_config_invariants.py +++ b/tests/core/pyspec/eth2spec/test/phase0/unittests/test_config_invariants.py @@ -3,7 +3,7 @@ from eth2spec.test.context import ( with_all_phases, ) from eth2spec.test.helpers.constants import MAX_UINT_64 -from eth2spec.test.helpers.phases import ( +from eth2spec.test.helpers.forks import ( is_post_altair, is_post_bellatrix, )