operations suite generator for phase0
This commit is contained in:
parent
c4bf772d30
commit
94d4e3a944
|
@ -35,6 +35,8 @@ if __name__ == "__main__":
|
||||||
gen_runner.run_generator("epoch_processing", [
|
gen_runner.run_generator("epoch_processing", [
|
||||||
create_suite('crosslinks', 'minimal', lambda: generate_from_tests(test_process_crosslinks, 'phase0')),
|
create_suite('crosslinks', 'minimal', lambda: generate_from_tests(test_process_crosslinks, 'phase0')),
|
||||||
create_suite('crosslinks', 'mainnet', lambda: generate_from_tests(test_process_crosslinks, 'phase0')),
|
create_suite('crosslinks', 'mainnet', lambda: generate_from_tests(test_process_crosslinks, 'phase0')),
|
||||||
create_suite('registry_updates', 'minimal', lambda: generate_from_tests(test_process_registry_updates, 'phase0')),
|
create_suite('registry_updates', 'minimal',
|
||||||
create_suite('registry_updates', 'mainnet', lambda: generate_from_tests(test_process_registry_updates, 'phase0')),
|
lambda: generate_from_tests(test_process_registry_updates, 'phase0')),
|
||||||
|
create_suite('registry_updates', 'mainnet',
|
||||||
|
lambda: generate_from_tests(test_process_registry_updates, 'phase0')),
|
||||||
])
|
])
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
from typing import Callable, Iterable
|
from typing import Callable, Iterable
|
||||||
|
|
||||||
from eth2spec.test.block_processing import (
|
from eth2spec.test.phase_0.block_processing import (
|
||||||
test_process_attestation,
|
test_process_attestation,
|
||||||
test_process_attester_slashing,
|
test_process_attester_slashing,
|
||||||
test_process_block_header,
|
test_process_block_header,
|
||||||
test_process_deposit,
|
test_process_deposit,
|
||||||
test_process_proposer_slashing,
|
test_process_proposer_slashing,
|
||||||
test_process_transfer,
|
test_process_transfer,
|
||||||
test_process_voluntary_exit
|
test_process_voluntary_exit,
|
||||||
)
|
)
|
||||||
|
|
||||||
from gen_base import gen_runner, gen_suite, gen_typing
|
from gen_base import gen_runner, gen_suite, gen_typing
|
||||||
|
@ -38,18 +38,18 @@ def create_suite(operation_name: str, config_name: str, get_cases: Callable[[],
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
gen_runner.run_generator("operations", [
|
gen_runner.run_generator("operations", [
|
||||||
create_suite('attestation', 'minimal', lambda: generate_from_tests(test_process_attestation)),
|
create_suite('attestation', 'minimal', lambda: generate_from_tests(test_process_attestation, 'phase0')),
|
||||||
create_suite('attestation', 'mainnet', lambda: generate_from_tests(test_process_attestation)),
|
create_suite('attestation', 'mainnet', lambda: generate_from_tests(test_process_attestation, 'phase0')),
|
||||||
create_suite('attester_slashing', 'minimal', lambda: generate_from_tests(test_process_attester_slashing)),
|
create_suite('attester_slashing', 'minimal', lambda: generate_from_tests(test_process_attester_slashing, 'phase0')),
|
||||||
create_suite('attester_slashing', 'mainnet', lambda: generate_from_tests(test_process_attester_slashing)),
|
create_suite('attester_slashing', 'mainnet', lambda: generate_from_tests(test_process_attester_slashing, 'phase0')),
|
||||||
create_suite('block_header', 'minimal', lambda: generate_from_tests(test_process_block_header)),
|
create_suite('block_header', 'minimal', lambda: generate_from_tests(test_process_block_header, 'phase0')),
|
||||||
create_suite('block_header', 'mainnet', lambda: generate_from_tests(test_process_block_header)),
|
create_suite('block_header', 'mainnet', lambda: generate_from_tests(test_process_block_header, 'phase0')),
|
||||||
create_suite('deposit', 'minimal', lambda: generate_from_tests(test_process_deposit)),
|
create_suite('deposit', 'minimal', lambda: generate_from_tests(test_process_deposit, 'phase0')),
|
||||||
create_suite('deposit', 'mainnet', lambda: generate_from_tests(test_process_deposit)),
|
create_suite('deposit', 'mainnet', lambda: generate_from_tests(test_process_deposit, 'phase0')),
|
||||||
create_suite('proposer_slashing', 'minimal', lambda: generate_from_tests(test_process_proposer_slashing)),
|
create_suite('proposer_slashing', 'minimal', lambda: generate_from_tests(test_process_proposer_slashing, 'phase0')),
|
||||||
create_suite('proposer_slashing', 'mainnet', lambda: generate_from_tests(test_process_proposer_slashing)),
|
create_suite('proposer_slashing', 'mainnet', lambda: generate_from_tests(test_process_proposer_slashing, 'phase0')),
|
||||||
create_suite('transfer', 'minimal', lambda: generate_from_tests(test_process_transfer)),
|
create_suite('transfer', 'minimal', lambda: generate_from_tests(test_process_transfer, 'phase0')),
|
||||||
create_suite('transfer', 'mainnet', lambda: generate_from_tests(test_process_transfer)),
|
create_suite('transfer', 'mainnet', lambda: generate_from_tests(test_process_transfer, 'phase0')),
|
||||||
create_suite('voluntary_exit', 'minimal', lambda: generate_from_tests(test_process_voluntary_exit)),
|
create_suite('voluntary_exit', 'minimal', lambda: generate_from_tests(test_process_voluntary_exit, 'phase0')),
|
||||||
create_suite('voluntary_exit', 'mainnet', lambda: generate_from_tests(test_process_voluntary_exit)),
|
create_suite('voluntary_exit', 'mainnet', lambda: generate_from_tests(test_process_voluntary_exit, 'phase0')),
|
||||||
])
|
])
|
||||||
|
|
|
@ -116,7 +116,7 @@ def with_phases(phases):
|
||||||
def decorator(fn):
|
def decorator(fn):
|
||||||
def run_with_spec_version(spec, *args, **kw):
|
def run_with_spec_version(spec, *args, **kw):
|
||||||
kw['spec'] = spec
|
kw['spec'] = spec
|
||||||
fn(*args, **kw)
|
return fn(*args, **kw)
|
||||||
|
|
||||||
def wrapper(*args, **kw):
|
def wrapper(*args, **kw):
|
||||||
run_phases = phases
|
run_phases = phases
|
||||||
|
@ -129,8 +129,9 @@ def with_phases(phases):
|
||||||
run_phases = [phase]
|
run_phases = [phase]
|
||||||
|
|
||||||
if 'phase0' in run_phases:
|
if 'phase0' in run_phases:
|
||||||
run_with_spec_version(spec_phase0, *args, **kw)
|
ret = run_with_spec_version(spec_phase0, *args, **kw)
|
||||||
if 'phase1' in run_phases:
|
if 'phase1' in run_phases:
|
||||||
run_with_spec_version(spec_phase1, *args, **kw)
|
ret = run_with_spec_version(spec_phase1, *args, **kw)
|
||||||
|
return ret
|
||||||
return wrapper
|
return wrapper
|
||||||
return decorator
|
return decorator
|
||||||
|
|
Loading…
Reference in New Issue