diff --git a/tests/core/pyspec/eth2spec/test/phase_0/__init__.py b/tests/core/pyspec/eth2spec/test/phase0/__init__.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/phase_0/__init__.py rename to tests/core/pyspec/eth2spec/test/phase0/__init__.py diff --git a/tests/core/pyspec/eth2spec/test/phase_0/block_processing/__init__.py b/tests/core/pyspec/eth2spec/test/phase0/block_processing/__init__.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/phase_0/block_processing/__init__.py rename to tests/core/pyspec/eth2spec/test/phase0/block_processing/__init__.py diff --git a/tests/core/pyspec/eth2spec/test/phase_0/block_processing/test_process_attestation.py b/tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_attestation.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/phase_0/block_processing/test_process_attestation.py rename to tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_attestation.py diff --git a/tests/core/pyspec/eth2spec/test/phase_0/block_processing/test_process_attester_slashing.py b/tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_attester_slashing.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/phase_0/block_processing/test_process_attester_slashing.py rename to tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_attester_slashing.py diff --git a/tests/core/pyspec/eth2spec/test/phase_0/block_processing/test_process_block_header.py b/tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_block_header.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/phase_0/block_processing/test_process_block_header.py rename to tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_block_header.py diff --git a/tests/core/pyspec/eth2spec/test/phase_0/block_processing/test_process_deposit.py b/tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_deposit.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/phase_0/block_processing/test_process_deposit.py rename to tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_deposit.py diff --git a/tests/core/pyspec/eth2spec/test/phase_0/block_processing/test_process_proposer_slashing.py b/tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_proposer_slashing.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/phase_0/block_processing/test_process_proposer_slashing.py rename to tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_proposer_slashing.py diff --git a/tests/core/pyspec/eth2spec/test/phase_0/block_processing/test_process_voluntary_exit.py b/tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_voluntary_exit.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/phase_0/block_processing/test_process_voluntary_exit.py rename to tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_voluntary_exit.py diff --git a/tests/core/pyspec/eth2spec/test/phase_0/epoch_processing/__init__.py b/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/__init__.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/phase_0/epoch_processing/__init__.py rename to tests/core/pyspec/eth2spec/test/phase0/epoch_processing/__init__.py diff --git a/tests/core/pyspec/eth2spec/test/phase_0/epoch_processing/run_epoch_process_base.py b/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/run_epoch_process_base.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/phase_0/epoch_processing/run_epoch_process_base.py rename to tests/core/pyspec/eth2spec/test/phase0/epoch_processing/run_epoch_process_base.py diff --git a/tests/core/pyspec/eth2spec/test/phase_0/epoch_processing/test_process_final_updates.py b/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_final_updates.py similarity index 98% rename from tests/core/pyspec/eth2spec/test/phase_0/epoch_processing/test_process_final_updates.py rename to tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_final_updates.py index 8cb09be0e..27676a59a 100644 --- a/tests/core/pyspec/eth2spec/test/phase_0/epoch_processing/test_process_final_updates.py +++ b/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_final_updates.py @@ -1,5 +1,5 @@ from eth2spec.test.context import spec_state_test, with_all_phases -from eth2spec.test.phase_0.epoch_processing.run_epoch_process_base import ( +from eth2spec.test.phase0.epoch_processing.run_epoch_process_base import ( run_epoch_processing_with, run_epoch_processing_to ) from eth2spec.test.helpers.state import transition_to diff --git a/tests/core/pyspec/eth2spec/test/phase_0/epoch_processing/test_process_justification_and_finalization.py b/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_justification_and_finalization.py similarity index 99% rename from tests/core/pyspec/eth2spec/test/phase_0/epoch_processing/test_process_justification_and_finalization.py rename to tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_justification_and_finalization.py index 09af2126d..a5408c9ad 100644 --- a/tests/core/pyspec/eth2spec/test/phase_0/epoch_processing/test_process_justification_and_finalization.py +++ b/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_justification_and_finalization.py @@ -1,5 +1,5 @@ from eth2spec.test.context import spec_state_test, with_all_phases -from eth2spec.test.phase_0.epoch_processing.run_epoch_process_base import ( +from eth2spec.test.phase0.epoch_processing.run_epoch_process_base import ( run_epoch_processing_with ) from eth2spec.test.helpers.state import transition_to diff --git a/tests/core/pyspec/eth2spec/test/phase_0/epoch_processing/test_process_registry_updates.py b/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_registry_updates.py similarity index 98% rename from tests/core/pyspec/eth2spec/test/phase_0/epoch_processing/test_process_registry_updates.py rename to tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_registry_updates.py index b6597b1cf..c734010f3 100644 --- a/tests/core/pyspec/eth2spec/test/phase_0/epoch_processing/test_process_registry_updates.py +++ b/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_registry_updates.py @@ -1,7 +1,7 @@ from eth2spec.test.helpers.deposits import mock_deposit from eth2spec.test.helpers.state import next_epoch, next_slots from eth2spec.test.context import spec_state_test, with_all_phases -from eth2spec.test.phase_0.epoch_processing.run_epoch_process_base import run_epoch_processing_with +from eth2spec.test.phase0.epoch_processing.run_epoch_process_base import run_epoch_processing_with def run_process_registry_updates(spec, state): diff --git a/tests/core/pyspec/eth2spec/test/phase_0/epoch_processing/test_process_rewards_and_penalties.py b/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_rewards_and_penalties.py similarity index 98% rename from tests/core/pyspec/eth2spec/test/phase_0/epoch_processing/test_process_rewards_and_penalties.py rename to tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_rewards_and_penalties.py index bafefcad6..d3744f897 100644 --- a/tests/core/pyspec/eth2spec/test/phase_0/epoch_processing/test_process_rewards_and_penalties.py +++ b/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_rewards_and_penalties.py @@ -1,4 +1,5 @@ from eth2spec.test.context import ( + PHASE0, spec_state_test, spec_test, with_all_phases, with_phases, single_phase, with_custom_state, @@ -16,7 +17,7 @@ from eth2spec.test.helpers.attestations import ( ) from eth2spec.test.helpers.rewards import leaking from eth2spec.test.helpers.attester_slashings import get_indexed_attestation_participants -from eth2spec.test.phase_0.epoch_processing.run_epoch_process_base import run_epoch_processing_with +from eth2spec.test.phase0.epoch_processing.run_epoch_process_base import run_epoch_processing_with from random import Random @@ -24,7 +25,7 @@ def run_process_rewards_and_penalties(spec, state): yield from run_epoch_processing_with(spec, state, 'process_rewards_and_penalties') -@with_phases(['phase0']) +@with_phases([PHASE0]) @spec_state_test def test_genesis_epoch_no_attestations_no_penalties(spec, state): pre_state = state.copy() @@ -37,7 +38,7 @@ def test_genesis_epoch_no_attestations_no_penalties(spec, state): assert state.balances[index] == pre_state.balances[index] -@with_phases(['phase0']) +@with_phases([PHASE0]) @spec_state_test def test_genesis_epoch_full_attestations_no_rewards(spec, state): attestations = [] diff --git a/tests/core/pyspec/eth2spec/test/phase_0/epoch_processing/test_process_slashings.py b/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_slashings.py similarity index 98% rename from tests/core/pyspec/eth2spec/test/phase_0/epoch_processing/test_process_slashings.py rename to tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_slashings.py index 23c8ce11a..5101c7548 100644 --- a/tests/core/pyspec/eth2spec/test/phase_0/epoch_processing/test_process_slashings.py +++ b/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_slashings.py @@ -1,5 +1,5 @@ from eth2spec.test.context import spec_state_test, with_all_phases -from eth2spec.test.phase_0.epoch_processing.run_epoch_process_base import ( +from eth2spec.test.phase0.epoch_processing.run_epoch_process_base import ( run_epoch_processing_with, run_epoch_processing_to ) from eth2spec.test.helpers.state import next_epoch diff --git a/tests/core/pyspec/eth2spec/test/phase_0/rewards/__init__.py b/tests/core/pyspec/eth2spec/test/phase0/rewards/__init__.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/phase_0/rewards/__init__.py rename to tests/core/pyspec/eth2spec/test/phase0/rewards/__init__.py diff --git a/tests/core/pyspec/eth2spec/test/phase_0/rewards/test_basic.py b/tests/core/pyspec/eth2spec/test/phase0/rewards/test_basic.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/phase_0/rewards/test_basic.py rename to tests/core/pyspec/eth2spec/test/phase0/rewards/test_basic.py diff --git a/tests/core/pyspec/eth2spec/test/phase_0/rewards/test_leak.py b/tests/core/pyspec/eth2spec/test/phase0/rewards/test_leak.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/phase_0/rewards/test_leak.py rename to tests/core/pyspec/eth2spec/test/phase0/rewards/test_leak.py diff --git a/tests/core/pyspec/eth2spec/test/phase_0/rewards/test_random.py b/tests/core/pyspec/eth2spec/test/phase0/rewards/test_random.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/phase_0/rewards/test_random.py rename to tests/core/pyspec/eth2spec/test/phase0/rewards/test_random.py diff --git a/tests/core/pyspec/eth2spec/test/phase_0/sanity/__init__.py b/tests/core/pyspec/eth2spec/test/phase0/sanity/__init__.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/phase_0/sanity/__init__.py rename to tests/core/pyspec/eth2spec/test/phase0/sanity/__init__.py diff --git a/tests/core/pyspec/eth2spec/test/phase_0/sanity/test_blocks.py b/tests/core/pyspec/eth2spec/test/phase0/sanity/test_blocks.py similarity index 99% rename from tests/core/pyspec/eth2spec/test/phase_0/sanity/test_blocks.py rename to tests/core/pyspec/eth2spec/test/phase0/sanity/test_blocks.py index 1e057e5a9..c3b1dceed 100644 --- a/tests/core/pyspec/eth2spec/test/phase_0/sanity/test_blocks.py +++ b/tests/core/pyspec/eth2spec/test/phase0/sanity/test_blocks.py @@ -21,8 +21,8 @@ from eth2spec.test.helpers.deposits import prepare_state_and_deposit from eth2spec.test.helpers.shard_transitions import get_shard_transition_of_committee from eth2spec.test.context import ( + PHASE0, PHASE1, spec_state_test, with_all_phases, expect_assertion_error, always_bls, with_phases, - PHASE1 ) @@ -113,7 +113,7 @@ def process_and_sign_block_without_header_validations(spec, state, block): return sign_block(spec, state, block) -@with_phases(['phase0']) +@with_phases([PHASE0]) @spec_state_test def test_proposal_for_genesis_slot(spec, state): assert state.slot == spec.GENESIS_SLOT @@ -484,7 +484,7 @@ def test_duplicate_attester_slashing(spec, state): # All AttesterSlashing tests should be adopted for Phase 1 but helper support is not yet there -@with_phases(['phase0']) +@with_phases([PHASE0]) @spec_state_test def test_multiple_attester_slashings_no_overlap(spec, state): # Skip test if config cannot handle multiple AttesterSlashings per block @@ -525,7 +525,7 @@ def test_multiple_attester_slashings_no_overlap(spec, state): check_attester_slashing_effect(spec, pre_state, state, full_indices) -@with_phases(['phase0']) +@with_phases([PHASE0]) @spec_state_test def test_multiple_attester_slashings_partial_overlap(spec, state): # Skip test if config cannot handle multiple AttesterSlashings per block @@ -740,7 +740,7 @@ def prepare_signed_exits(spec, state, indices): # exceeding the minimal-config randao mixes memory size. # Applies to all voluntary-exit sanity block tests. -@with_phases(['phase0']) +@with_phases([PHASE0]) @spec_state_test def test_voluntary_exit(spec, state): validator_index = spec.get_active_validator_indices(state, spec.get_current_epoch(state))[-1] @@ -768,7 +768,7 @@ def test_voluntary_exit(spec, state): assert state.validators[validator_index].exit_epoch < spec.FAR_FUTURE_EPOCH -@with_phases(['phase0']) +@with_phases([PHASE0]) @spec_state_test def test_double_validator_exit_same_block(spec, state): validator_index = spec.get_active_validator_indices(state, spec.get_current_epoch(state))[-1] @@ -789,7 +789,7 @@ def test_double_validator_exit_same_block(spec, state): yield 'post', None -@with_phases(['phase0']) +@with_phases([PHASE0]) @spec_state_test def test_multiple_different_validator_exits_same_block(spec, state): validator_indices = [ diff --git a/tests/core/pyspec/eth2spec/test/phase_0/sanity/test_slots.py b/tests/core/pyspec/eth2spec/test/phase0/sanity/test_slots.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/phase_0/sanity/test_slots.py rename to tests/core/pyspec/eth2spec/test/phase0/sanity/test_slots.py diff --git a/tests/core/pyspec/eth2spec/test/phase_1/__init__.py b/tests/core/pyspec/eth2spec/test/phase1/__init__.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/phase_1/__init__.py rename to tests/core/pyspec/eth2spec/test/phase1/__init__.py diff --git a/tests/core/pyspec/eth2spec/test/phase_1/block_processing/__init__.py b/tests/core/pyspec/eth2spec/test/phase1/block_processing/__init__.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/phase_1/block_processing/__init__.py rename to tests/core/pyspec/eth2spec/test/phase1/block_processing/__init__.py diff --git a/tests/core/pyspec/eth2spec/test/phase_1/block_processing/test_process_attestation.py b/tests/core/pyspec/eth2spec/test/phase1/block_processing/test_process_attestation.py similarity index 91% rename from tests/core/pyspec/eth2spec/test/phase_1/block_processing/test_process_attestation.py rename to tests/core/pyspec/eth2spec/test/phase1/block_processing/test_process_attestation.py index 34ff28412..a0cf7472f 100644 --- a/tests/core/pyspec/eth2spec/test/phase_1/block_processing/test_process_attestation.py +++ b/tests/core/pyspec/eth2spec/test/phase1/block_processing/test_process_attestation.py @@ -1,4 +1,5 @@ from eth2spec.test.context import ( + PHASE0, with_all_phases_except, spec_state_test, always_bls, @@ -11,7 +12,7 @@ from eth2spec.test.helpers.attestations import ( ) -@with_all_phases_except(['phase0']) +@with_all_phases_except([PHASE0]) @spec_state_test @always_bls def test_on_time_success(spec, state): @@ -22,7 +23,7 @@ def test_on_time_success(spec, state): yield from run_attestation_processing(spec, state, attestation) -@with_all_phases_except(['phase0']) +@with_all_phases_except([PHASE0]) @spec_state_test @always_bls def test_late_success(spec, state): diff --git a/tests/core/pyspec/eth2spec/test/phase_1/block_processing/test_process_chunk_challenge.py b/tests/core/pyspec/eth2spec/test/phase1/block_processing/test_process_chunk_challenge.py similarity index 96% rename from tests/core/pyspec/eth2spec/test/phase_1/block_processing/test_process_chunk_challenge.py rename to tests/core/pyspec/eth2spec/test/phase1/block_processing/test_process_chunk_challenge.py index bdb4325fd..c9adabb62 100644 --- a/tests/core/pyspec/eth2spec/test/phase_1/block_processing/test_process_chunk_challenge.py +++ b/tests/core/pyspec/eth2spec/test/phase1/block_processing/test_process_chunk_challenge.py @@ -8,11 +8,12 @@ from eth2spec.test.helpers.attestations import ( ) from eth2spec.test.helpers.state import transition_to from eth2spec.test.context import ( + PHASE0, with_all_phases_except, spec_state_test, expect_assertion_error, ) -from eth2spec.test.phase_0.block_processing.test_process_attestation import run_attestation_processing +from eth2spec.test.phase0.block_processing.test_process_attestation import run_attestation_processing def run_chunk_challenge_processing(spec, state, custody_chunk_challenge, valid=True): @@ -64,7 +65,7 @@ def run_custody_chunk_response_processing(spec, state, custody_response, valid=T yield 'post', state -@with_all_phases_except(['phase0']) +@with_all_phases_except([PHASE0]) @spec_state_test def test_challenge_appended(spec, state): transition_to(spec, state, state.slot + 1) @@ -85,7 +86,7 @@ def test_challenge_appended(spec, state): yield from run_chunk_challenge_processing(spec, state, challenge) -@with_all_phases_except(['phase0']) +@with_all_phases_except([PHASE0]) @spec_state_test def test_challenge_empty_element_replaced(spec, state): transition_to(spec, state, state.slot + 1) @@ -108,7 +109,7 @@ def test_challenge_empty_element_replaced(spec, state): yield from run_chunk_challenge_processing(spec, state, challenge) -@with_all_phases_except(['phase0']) +@with_all_phases_except([PHASE0]) @spec_state_test def test_duplicate_challenge(spec, state): transition_to(spec, state, state.slot + 1) @@ -131,7 +132,7 @@ def test_duplicate_challenge(spec, state): yield from run_chunk_challenge_processing(spec, state, challenge, valid=False) -@with_all_phases_except(['phase0']) +@with_all_phases_except([PHASE0]) @spec_state_test def test_second_challenge(spec, state): transition_to(spec, state, state.slot + 1) @@ -156,7 +157,7 @@ def test_second_challenge(spec, state): yield from run_chunk_challenge_processing(spec, state, challenge1) -@with_all_phases_except(['phase0']) +@with_all_phases_except([PHASE0]) @spec_state_test def test_multiple_epochs_custody(spec, state): transition_to(spec, state, state.slot + spec.SLOTS_PER_EPOCH * 3) @@ -178,7 +179,7 @@ def test_multiple_epochs_custody(spec, state): yield from run_chunk_challenge_processing(spec, state, challenge) -@with_all_phases_except(['phase0']) +@with_all_phases_except([PHASE0]) @spec_state_test def test_many_epochs_custody(spec, state): transition_to(spec, state, state.slot + spec.SLOTS_PER_EPOCH * 20) @@ -200,7 +201,7 @@ def test_many_epochs_custody(spec, state): yield from run_chunk_challenge_processing(spec, state, challenge) -@with_all_phases_except(['phase0']) +@with_all_phases_except([PHASE0]) @spec_state_test def test_off_chain_attestation(spec, state): transition_to(spec, state, state.slot + spec.SLOTS_PER_EPOCH) @@ -218,7 +219,7 @@ def test_off_chain_attestation(spec, state): yield from run_chunk_challenge_processing(spec, state, challenge) -@with_all_phases_except(['phase0']) +@with_all_phases_except([PHASE0]) @spec_state_test def test_custody_response(spec, state): transition_to(spec, state, state.slot + spec.SLOTS_PER_EPOCH) @@ -246,7 +247,7 @@ def test_custody_response(spec, state): yield from run_custody_chunk_response_processing(spec, state, custody_response) -@with_all_phases_except(['phase0']) +@with_all_phases_except([PHASE0]) @spec_state_test def test_custody_response_multiple_epochs(spec, state): transition_to(spec, state, state.slot + spec.SLOTS_PER_EPOCH * 3) @@ -274,7 +275,7 @@ def test_custody_response_multiple_epochs(spec, state): yield from run_custody_chunk_response_processing(spec, state, custody_response) -@with_all_phases_except(['phase0']) +@with_all_phases_except([PHASE0]) @spec_state_test def test_custody_response_many_epochs(spec, state): transition_to(spec, state, state.slot + spec.SLOTS_PER_EPOCH * 20) diff --git a/tests/core/pyspec/eth2spec/test/phase_1/block_processing/test_process_custody_key_reveal.py b/tests/core/pyspec/eth2spec/test/phase1/block_processing/test_process_custody_key_reveal.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/phase_1/block_processing/test_process_custody_key_reveal.py rename to tests/core/pyspec/eth2spec/test/phase1/block_processing/test_process_custody_key_reveal.py diff --git a/tests/core/pyspec/eth2spec/test/phase_1/block_processing/test_process_custody_slashing.py b/tests/core/pyspec/eth2spec/test/phase1/block_processing/test_process_custody_slashing.py similarity index 94% rename from tests/core/pyspec/eth2spec/test/phase_1/block_processing/test_process_custody_slashing.py rename to tests/core/pyspec/eth2spec/test/phase1/block_processing/test_process_custody_slashing.py index ec0bac82d..07cd76996 100644 --- a/tests/core/pyspec/eth2spec/test/phase_1/block_processing/test_process_custody_slashing.py +++ b/tests/core/pyspec/eth2spec/test/phase1/block_processing/test_process_custody_slashing.py @@ -9,11 +9,12 @@ from eth2spec.test.helpers.attestations import ( from eth2spec.utils.ssz.ssz_typing import ByteList from eth2spec.test.helpers.state import get_balance, transition_to from eth2spec.test.context import ( + PHASE0, with_all_phases_except, spec_state_test, expect_assertion_error, ) -from eth2spec.test.phase_0.block_processing.test_process_attestation import run_attestation_processing +from eth2spec.test.phase0.block_processing.test_process_attestation import run_attestation_processing def run_custody_slashing_processing(spec, state, custody_slashing, valid=True, correct=True): @@ -102,31 +103,31 @@ def run_standard_custody_slashing_test(spec, yield from run_custody_slashing_processing(spec, state, slashing, valid=valid, correct=correct) -@with_all_phases_except(['phase0']) +@with_all_phases_except([PHASE0]) @spec_state_test def test_custody_slashing(spec, state): yield from run_standard_custody_slashing_test(spec, state) -@with_all_phases_except(['phase0']) +@with_all_phases_except([PHASE0]) @spec_state_test def test_incorrect_custody_slashing(spec, state): yield from run_standard_custody_slashing_test(spec, state, correct=False) -@with_all_phases_except(['phase0']) +@with_all_phases_except([PHASE0]) @spec_state_test def test_multiple_epochs_custody(spec, state): yield from run_standard_custody_slashing_test(spec, state, shard_lateness=spec.SLOTS_PER_EPOCH * 3) -@with_all_phases_except(['phase0']) +@with_all_phases_except([PHASE0]) @spec_state_test def test_many_epochs_custody(spec, state): yield from run_standard_custody_slashing_test(spec, state, shard_lateness=spec.SLOTS_PER_EPOCH * 10) -@with_all_phases_except(['phase0']) +@with_all_phases_except([PHASE0]) @spec_state_test def test_invalid_custody_slashing(spec, state): yield from run_standard_custody_slashing_test( diff --git a/tests/core/pyspec/eth2spec/test/phase_1/block_processing/test_process_early_derived_secret_reveal.py b/tests/core/pyspec/eth2spec/test/phase1/block_processing/test_process_early_derived_secret_reveal.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/phase_1/block_processing/test_process_early_derived_secret_reveal.py rename to tests/core/pyspec/eth2spec/test/phase1/block_processing/test_process_early_derived_secret_reveal.py diff --git a/tests/core/pyspec/eth2spec/test/phase_1/block_processing/test_process_shard_transition.py b/tests/core/pyspec/eth2spec/test/phase1/block_processing/test_process_shard_transition.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/phase_1/block_processing/test_process_shard_transition.py rename to tests/core/pyspec/eth2spec/test/phase1/block_processing/test_process_shard_transition.py diff --git a/tests/core/pyspec/eth2spec/test/phase_1/epoch_processing/test_process_challenge_deadlines.py b/tests/core/pyspec/eth2spec/test/phase1/epoch_processing/test_process_challenge_deadlines.py similarity index 84% rename from tests/core/pyspec/eth2spec/test/phase_1/epoch_processing/test_process_challenge_deadlines.py rename to tests/core/pyspec/eth2spec/test/phase1/epoch_processing/test_process_challenge_deadlines.py index f3675732a..675b0d8da 100644 --- a/tests/core/pyspec/eth2spec/test/phase_1/epoch_processing/test_process_challenge_deadlines.py +++ b/tests/core/pyspec/eth2spec/test/phase1/epoch_processing/test_process_challenge_deadlines.py @@ -7,13 +7,14 @@ from eth2spec.test.helpers.attestations import ( ) from eth2spec.test.helpers.state import transition_to from eth2spec.test.context import ( + PHASE0, with_all_phases_except, spec_state_test, ) -from eth2spec.test.phase_0.block_processing.test_process_attestation import run_attestation_processing -from eth2spec.test.phase_0.epoch_processing.run_epoch_process_base import run_epoch_processing_with +from eth2spec.test.phase0.block_processing.test_process_attestation import run_attestation_processing +from eth2spec.test.phase0.epoch_processing.run_epoch_process_base import run_epoch_processing_with -from eth2spec.test.phase_1.block_processing.test_process_chunk_challenge import ( +from eth2spec.test.phase1.block_processing.test_process_chunk_challenge import ( run_chunk_challenge_processing, ) @@ -22,7 +23,7 @@ def run_process_challenge_deadlines(spec, state): yield from run_epoch_processing_with(spec, state, 'process_challenge_deadlines') -@with_all_phases_except(['phase0']) +@with_all_phases_except([PHASE0]) @spec_state_test def test_validator_slashed_after_chunk_challenge(spec, state): transition_to(spec, state, state.slot + 1) diff --git a/tests/core/pyspec/eth2spec/test/phase_1/epoch_processing/test_process_custody_final_updates.py b/tests/core/pyspec/eth2spec/test/phase1/epoch_processing/test_process_custody_final_updates.py similarity index 91% rename from tests/core/pyspec/eth2spec/test/phase_1/epoch_processing/test_process_custody_final_updates.py rename to tests/core/pyspec/eth2spec/test/phase1/epoch_processing/test_process_custody_final_updates.py index 6ca6c8c99..630ddc3a7 100644 --- a/tests/core/pyspec/eth2spec/test/phase_1/epoch_processing/test_process_custody_final_updates.py +++ b/tests/core/pyspec/eth2spec/test/phase1/epoch_processing/test_process_custody_final_updates.py @@ -1,3 +1,6 @@ +from eth2spec.test.context import ( + PHASE0, +) from eth2spec.test.helpers.custody import ( get_valid_chunk_challenge, get_valid_custody_chunk_response, @@ -12,21 +15,21 @@ from eth2spec.test.context import ( with_all_phases_except, spec_state_test, ) -from eth2spec.test.phase_0.block_processing.test_process_attestation import run_attestation_processing -from eth2spec.test.phase_0.epoch_processing.run_epoch_process_base import run_epoch_processing_with +from eth2spec.test.phase0.block_processing.test_process_attestation import run_attestation_processing +from eth2spec.test.phase0.epoch_processing.run_epoch_process_base import run_epoch_processing_with -from eth2spec.test.phase_1.block_processing.test_process_chunk_challenge import ( +from eth2spec.test.phase1.block_processing.test_process_chunk_challenge import ( run_chunk_challenge_processing, run_custody_chunk_response_processing, ) -from eth2spec.test.phase_1.block_processing.test_process_custody_key_reveal import run_custody_key_reveal_processing +from eth2spec.test.phase1.block_processing.test_process_custody_key_reveal import run_custody_key_reveal_processing def run_process_custody_final_updates(spec, state): yield from run_epoch_processing_with(spec, state, 'process_custody_final_updates') -@with_all_phases_except(['phase0']) +@with_all_phases_except([PHASE0]) @spec_state_test def test_validator_withdrawal_delay(spec, state): spec.initiate_validator_exit(state, 0) @@ -37,7 +40,7 @@ def test_validator_withdrawal_delay(spec, state): assert state.validators[0].withdrawable_epoch == spec.FAR_FUTURE_EPOCH -@with_all_phases_except(['phase0']) +@with_all_phases_except([PHASE0]) @spec_state_test def test_validator_withdrawal_reenable_after_custody_reveal(spec, state): spec.initiate_validator_exit(state, 0) @@ -60,7 +63,7 @@ def test_validator_withdrawal_reenable_after_custody_reveal(spec, state): assert state.validators[0].withdrawable_epoch < spec.FAR_FUTURE_EPOCH -@with_all_phases_except(['phase0']) +@with_all_phases_except([PHASE0]) @spec_state_test def test_validator_withdrawal_suspend_after_chunk_challenge(spec, state): transition_to(spec, state, state.slot + 1) @@ -108,7 +111,7 @@ def test_validator_withdrawal_suspend_after_chunk_challenge(spec, state): assert state.validators[validator_index].withdrawable_epoch == spec.FAR_FUTURE_EPOCH -@with_all_phases_except(['phase0']) +@with_all_phases_except([PHASE0]) @spec_state_test def test_validator_withdrawal_resume_after_chunk_challenge_response(spec, state): transition_to(spec, state, state.slot + 1) diff --git a/tests/core/pyspec/eth2spec/test/phase_1/epoch_processing/test_process_reveal_deadlines.py b/tests/core/pyspec/eth2spec/test/phase1/epoch_processing/test_process_reveal_deadlines.py similarity index 85% rename from tests/core/pyspec/eth2spec/test/phase_1/epoch_processing/test_process_reveal_deadlines.py rename to tests/core/pyspec/eth2spec/test/phase1/epoch_processing/test_process_reveal_deadlines.py index 9cc0069b9..da1a60446 100644 --- a/tests/core/pyspec/eth2spec/test/phase_1/epoch_processing/test_process_reveal_deadlines.py +++ b/tests/core/pyspec/eth2spec/test/phase1/epoch_processing/test_process_reveal_deadlines.py @@ -3,18 +3,19 @@ from eth2spec.test.helpers.custody import ( ) from eth2spec.test.helpers.state import transition_to from eth2spec.test.context import ( + PHASE0, with_all_phases_except, spec_state_test, ) -from eth2spec.test.phase_0.epoch_processing.run_epoch_process_base import run_epoch_processing_with -from eth2spec.test.phase_1.block_processing.test_process_custody_key_reveal import run_custody_key_reveal_processing +from eth2spec.test.phase0.epoch_processing.run_epoch_process_base import run_epoch_processing_with +from eth2spec.test.phase1.block_processing.test_process_custody_key_reveal import run_custody_key_reveal_processing def run_process_challenge_deadlines(spec, state): yield from run_epoch_processing_with(spec, state, 'process_challenge_deadlines') -@with_all_phases_except(['phase0']) +@with_all_phases_except([PHASE0]) @spec_state_test def test_validator_slashed_after_reveal_deadline(spec, state): assert state.validators[0].slashed == 0 @@ -33,7 +34,7 @@ def test_validator_slashed_after_reveal_deadline(spec, state): assert state.validators[0].slashed == 1 -@with_all_phases_except(['phase0']) +@with_all_phases_except([PHASE0]) @spec_state_test def test_validator_not_slashed_after_reveal(spec, state): transition_to(spec, state, spec.EPOCHS_PER_CUSTODY_PERIOD * spec.SLOTS_PER_EPOCH) diff --git a/tests/core/pyspec/eth2spec/test/phase_1/sanity/__init__.py b/tests/core/pyspec/eth2spec/test/phase1/sanity/__init__.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/phase_1/sanity/__init__.py rename to tests/core/pyspec/eth2spec/test/phase1/sanity/__init__.py diff --git a/tests/core/pyspec/eth2spec/test/phase_1/sanity/test_blocks.py b/tests/core/pyspec/eth2spec/test/phase1/sanity/test_blocks.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/phase_1/sanity/test_blocks.py rename to tests/core/pyspec/eth2spec/test/phase1/sanity/test_blocks.py diff --git a/tests/core/pyspec/eth2spec/test/phase_1/unittests/__init__.py b/tests/core/pyspec/eth2spec/test/phase1/unittests/__init__.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/phase_1/unittests/__init__.py rename to tests/core/pyspec/eth2spec/test/phase1/unittests/__init__.py diff --git a/tests/core/pyspec/eth2spec/test/phase_1/unittests/test_get_start_shard.py b/tests/core/pyspec/eth2spec/test/phase1/unittests/test_get_start_shard.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/phase_1/unittests/test_get_start_shard.py rename to tests/core/pyspec/eth2spec/test/phase1/unittests/test_get_start_shard.py diff --git a/tests/core/pyspec/eth2spec/test/test_finality.py b/tests/core/pyspec/eth2spec/test/test_finality.py index 55ccde2d9..adbadcdf2 100644 --- a/tests/core/pyspec/eth2spec/test/test_finality.py +++ b/tests/core/pyspec/eth2spec/test/test_finality.py @@ -1,4 +1,4 @@ -from eth2spec.test.context import spec_state_test, never_bls, with_all_phases, with_phases +from eth2spec.test.context import PHASE0, spec_state_test, never_bls, with_all_phases, with_phases from eth2spec.test.helpers.state import next_epoch_via_block from eth2spec.test.helpers.attestations import next_epoch_with_attestations @@ -28,7 +28,7 @@ def check_finality(spec, assert state.finalized_checkpoint == prev_state.finalized_checkpoint -@with_phases(["phase0"]) +@with_phases([PHASE0]) @spec_state_test @never_bls def test_finality_no_updates_at_genesis(spec, state): diff --git a/tests/generators/epoch_processing/main.py b/tests/generators/epoch_processing/main.py index f3bbc21e6..13ac76f41 100644 --- a/tests/generators/epoch_processing/main.py +++ b/tests/generators/epoch_processing/main.py @@ -2,7 +2,7 @@ from typing import Iterable from eth2spec.phase0 import spec as spec_phase0 from eth2spec.phase1 import spec as spec_phase1 -from eth2spec.test.phase_0.epoch_processing import ( +from eth2spec.test.phase0.epoch_processing import ( test_process_final_updates, test_process_justification_and_finalization, test_process_registry_updates, diff --git a/tests/generators/operations/main.py b/tests/generators/operations/main.py index 935c7aa63..6d4f6d139 100644 --- a/tests/generators/operations/main.py +++ b/tests/generators/operations/main.py @@ -1,6 +1,6 @@ from typing import Iterable -from eth2spec.test.phase_0.block_processing import ( +from eth2spec.test.phase0.block_processing import ( test_process_attestation, test_process_attester_slashing, test_process_block_header, diff --git a/tests/generators/rewards/main.py b/tests/generators/rewards/main.py index c90943cab..5d063c434 100644 --- a/tests/generators/rewards/main.py +++ b/tests/generators/rewards/main.py @@ -2,7 +2,7 @@ from typing import Iterable from eth2spec.phase0 import spec as spec_phase0 from eth2spec.phase1 import spec as spec_phase1 -from eth2spec.test.phase_0.rewards import ( +from eth2spec.test.phase0.rewards import ( test_basic, test_leak, test_random, diff --git a/tests/generators/sanity/main.py b/tests/generators/sanity/main.py index 89fb89838..45a1c8c4f 100644 --- a/tests/generators/sanity/main.py +++ b/tests/generators/sanity/main.py @@ -5,7 +5,7 @@ from gen_base import gen_runner, gen_typing from gen_from_tests.gen import generate_from_tests from eth2spec.test.context import PHASE0 -from eth2spec.test.phase_0.sanity import test_blocks, test_slots +from eth2spec.test.phase0.sanity import test_blocks, test_slots from eth2spec.config import config_util from eth2spec.phase0 import spec as spec_phase0 from eth2spec.phase1 import spec as spec_phase1