コード例 #1
0
from eth2spec.gen_helpers.gen_from_tests.gen import run_state_test_generators, combine_mods
from eth2spec.test.helpers.constants import PHASE0, ALTAIR, MERGE


if __name__ == "__main__":
    phase_0_mods = {key: 'eth2spec.test.phase0.genesis.test_' + key for key in [
        'initialization',
        'validity',
    ]}

    # we have new unconditional lines in `initialize_beacon_state_from_eth1` and we want to test it
    altair_mods = phase_0_mods

    _new_merge_mods = {key: 'eth2spec.test.merge.genesis.test_' + key for key in [
        'initialization',
    ]}
    merge_mods = combine_mods(_new_merge_mods, altair_mods)

    all_mods = {
        PHASE0: phase_0_mods,
        ALTAIR: altair_mods,
        MERGE: merge_mods,
    }

    run_state_test_generators(runner_name="genesis", all_mods=all_mods)
コード例 #2
0
ファイル: main.py プロジェクト: benjaminion/eth2.0-specs
            'slashings_reset',
            'randao_mixes_reset',
            'historical_roots_update',
            'participation_record_updates',
        ]
    }

    _new_altair_mods = {
        key: 'eth2spec.test.altair.epoch_processing.test_process_' + key
        for key in [
            'inactivity_updates',
            'participation_flag_updates',
            'sync_committee_updates',
        ]
    }
    altair_mods = combine_mods(_new_altair_mods, phase_0_mods)

    # No epoch-processing changes in Merge and previous testing repeats with new types, so no additional tests required.
    merge_mods = altair_mods

    # TODO Custody Game testgen is disabled for now
    # custody_game_mods = {**{key: 'eth2spec.test.custody_game.epoch_processing.test_process_' + key for key in [
    #     'reveal_deadlines',
    #     'challenge_deadlines',
    #     'custody_final_updates',
    # ]}, **phase_0_mods}  # also run the previous phase 0 tests (but against custody game spec)

    all_mods = {
        PHASE0: phase_0_mods,
        ALTAIR: altair_mods,
        MERGE: merge_mods,
コード例 #3
0
        for key in [
            'attestation',
            'attester_slashing',
            'block_header',
            'deposit',
            'proposer_slashing',
            'voluntary_exit',
        ]
    }
    _new_altair_mods = {
        'sync_aggregate': [
            'eth2spec.test.altair.block_processing.sync_aggregate.test_process_'
            + key for key in ['sync_aggregate', 'sync_aggregate_random']
        ]
    }
    altair_mods = combine_mods(_new_altair_mods, phase_0_mods)

    _new_bellatrix_mods = {
        key: 'eth2spec.test.bellatrix.block_processing.test_process_' + key
        for key in [
            'execution_payload',
        ]
    }
    bellatrix_mods = combine_mods(_new_bellatrix_mods, altair_mods)

    # TODO Custody Game testgen is disabled for now
    # _new_custody_game_mods = {key: 'eth2spec.test.custody_game.block_processing.test_process_' + key for key in [
    #     'attestation',
    #     'chunk_challenge',
    #     'custody_key_reveal',
    #     'custody_slashing',
コード例 #4
0
if __name__ == "__main__":
    phase_0_mods = {
        key: 'eth2spec.test.phase0.fork_choice.test_' + key
        for key in [
            'get_head',
            'on_block',
            'ex_ante',
        ]
    }
    # No additional Altair specific finality tests, yet.
    altair_mods = phase_0_mods

    # For merge `on_merge_block` test kind added with `pow_block_N.ssz` files with several
    # PowBlock's which should be resolved by `get_pow_block(hash: Hash32) -> PowBlock` function
    _new_bellatrix_mods = {
        key: 'eth2spec.test.bellatrix.fork_choice.test_' + key
        for key in [
            'on_merge_block',
        ]
    }
    bellatrix_mods = combine_mods(_new_bellatrix_mods, altair_mods)

    all_mods = {
        PHASE0: phase_0_mods,
        ALTAIR: altair_mods,
        BELLATRIX: bellatrix_mods,
    }

    run_state_test_generators(runner_name="fork_choice", all_mods=all_mods)
コード例 #5
0
        for key in [
            'attestation',
            'attester_slashing',
            'block_header',
            'deposit',
            'proposer_slashing',
            'voluntary_exit',
        ]
    }
    _new_altair_mods = {
        'sync_aggregate': [
            'eth2spec.test.altair.block_processing.sync_aggregate.test_process_'
            + key for key in ['sync_aggregate', 'sync_aggregate_random']
        ]
    }
    altair_mods = combine_mods(_new_altair_mods, phase_0_mods)

    _new_merge_mods = {
        key: 'eth2spec.test.merge.block_processing.test_process_' + key
        for key in [
            'execution_payload',
        ]
    }
    merge_mods = combine_mods(_new_merge_mods, altair_mods)

    # TODO Custody Game testgen is disabled for now
    # _new_custody_game_mods = {key: 'eth2spec.test.custody_game.block_processing.test_process_' + key for key in [
    #     'attestation',
    #     'chunk_challenge',
    #     'custody_key_reveal',
    #     'custody_slashing',