コード例 #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
from eth2spec.gen_helpers.gen_from_tests.gen import run_state_test_generators
from eth2spec.phase0 import spec as spec_phase0
from eth2spec.altair import spec as spec_altair
from eth2spec.merge import spec as spec_merge
from eth2spec.test.helpers.constants import PHASE0, ALTAIR, MERGE


specs = (spec_phase0, spec_altair, spec_merge)


if __name__ == "__main__":
    phase_0_mods = {'finality': 'eth2spec.test.phase0.finality.test_finality'}
    altair_mods = phase_0_mods   # No additional Altair specific finality tests
    merge_mods = phase_0_mods    # No additional Merge specific finality tests

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

    run_state_test_generators(runner_name="finality", specs=specs, all_mods=all_mods)
コード例 #3
0
ファイル: main.py プロジェクト: nuiiza27/eth2.0-specs
        'slashings_reset',
        'randao_mixes_reset',
        'historical_roots_update',
        'participation_record_updates',
    ]}
    altair_mods = {
        **{key: 'eth2spec.test.altair.epoch_processing.test_process_' + key for key in [
            'sync_committee_updates',
        ]},
        **phase_0_mods,
    }  # also run the previous phase 0 tests

    # No epoch-processing changes in Merge and previous testing repeats with new types, so no additional tests required.
    # TODO: rebase onto Altair testing later.
    merge_mods = phase_0_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,
    }

    run_state_test_generators(runner_name="epoch_processing", specs=specs, all_mods=all_mods)
コード例 #4
0
ファイル: main.py プロジェクト: vishwaphansal7/eth2.0-specs
from eth2spec.gen_helpers.gen_from_tests.gen import run_state_test_generators
from eth2spec.phase0 import spec as spec_phase0
from eth2spec.altair import spec as spec_altair
from eth2spec.test.context import PHASE0, ALTAIR

specs = (spec_phase0, spec_altair)

if __name__ == "__main__":
    phase_0_mods = {
        key: 'eth2spec.test.phase0.rewards.test_' + key
        for key in [
            'basic',
            'leak',
            'random',
        ]
    }
    # No additional altair specific rewards tests, yet.
    altair_mods = phase_0_mods

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

    run_state_test_generators(runner_name="rewards",
                              specs=specs,
                              all_mods=all_mods)
コード例 #5
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)
コード例 #6
0
    altair_mods = {
        **{key: 'eth2spec.test.altair.block_processing.test_process_' + key for key in [
            'sync_committee',
        ]},
        **phase_0_mods,
    }  # also run the previous phase 0 tests

    merge_mods = {
        **{key: 'eth2spec.test.merge.block_processing.test_process_' + key for key in [
            'execution_payload',
        ]},
        **phase_0_mods,  # TODO: runs phase0 tests. Rebase to include `altair_mods` testing later.
    }

    # TODO Custody Game testgen is disabled for now
    # custody_game_mods = {**{key: 'eth2spec.test.custody_game.block_processing.test_process_' + key for key in [
    #     'attestation',
    #     'chunk_challenge',
    #     'custody_key_reveal',
    #     'custody_slashing',
    #     'early_derived_secret_reveal',
    # ]}, **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,
    }

    run_state_test_generators(runner_name="operations", specs=specs, all_mods=all_mods)
コード例 #7
0
from eth2spec.test.helpers.constants import PHASE0, ALTAIR
from eth2spec.gen_helpers.gen_from_tests.gen import run_state_test_generators

if __name__ == "__main__":
    phase_0_mods = {
        key: 'eth2spec.test.phase0.random.test_' + key
        for key in [
            'random',
        ]
    }
    altair_mods = {
        key: 'eth2spec.test.altair.random.test_' + key
        for key in [
            'random',
        ]
    }

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

    run_state_test_generators(runner_name="random", all_mods=all_mods)
コード例 #8
0
ファイル: main.py プロジェクト: ethereum/eth2.0-specs
from eth2spec.test.helpers.constants import ALTAIR, BELLATRIX
from eth2spec.gen_helpers.gen_from_tests.gen import run_state_test_generators

if __name__ == "__main__":
    altair_mods = {
        key: 'eth2spec.test.altair.merkle.test_' + key
        for key in [
            'single_proof',
        ]
    }
    bellatrix_mods = altair_mods

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

    run_state_test_generators(runner_name="merkle", all_mods=all_mods)
コード例 #9
0
ファイル: main.py プロジェクト: benjaminion/eth2.0-specs
        key: 'eth2spec.test.phase0.sanity.test_' + key
        for key in [
            'blocks',
            'slots',
        ]
    }

    _new_altair_mods = {
        key: 'eth2spec.test.altair.sanity.test_' + key
        for key in [
            'blocks',
        ]
    }
    altair_mods = combine_mods(_new_altair_mods, phase_0_mods)

    _new_merge_mods = {
        key: 'eth2spec.test.merge.sanity.test_' + key
        for key in [
            'blocks',
        ]
    }
    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="sanity", all_mods=all_mods)