From 338be1f636b7eae6a6bb3182d4b6682984e788c7 Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Tue, 9 Mar 2021 16:27:06 -0700 Subject: [PATCH] clean up fork gens --- tests/formats/forks/README.md | 2 +- tests/generators/forks/main.py | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/formats/forks/README.md b/tests/formats/forks/README.md index 1a7ee64ad..57cc09227 100644 --- a/tests/formats/forks/README.md +++ b/tests/formats/forks/README.md @@ -3,7 +3,7 @@ The aim of the fork tests is to ensure that a pre-fork state can be transformed into a valid post-fork state, utilizing the `upgrade` function found in the relevant `fork.md` spec. -There is only one handler: `core`. Each fork (after genesis) is handled with the same format, +There is only one handler: `fork`. Each fork (after genesis) is handled with the same format, and the particular fork boundary being tested is noted in `meta.yaml`. ## Test case format diff --git a/tests/generators/forks/main.py b/tests/generators/forks/main.py index b22707786..1a603a0dc 100644 --- a/tests/generators/forks/main.py +++ b/tests/generators/forks/main.py @@ -11,7 +11,7 @@ from eth2spec.gen_helpers.gen_base import gen_runner, gen_typing from eth2spec.gen_helpers.gen_from_tests.gen import generate_from_tests -def create_provider(tests_src, config_name: str) -> gen_typing.TestProvider: +def create_provider(tests_src, config_name: str, phase: str, fork_name: str) -> gen_typing.TestProvider: def prepare_fn(configs_path: str) -> str: config_util.prepare_config(configs_path, config_name) @@ -24,8 +24,9 @@ def create_provider(tests_src, config_name: str) -> gen_typing.TestProvider: runner_name='fork', handler_name='fork', src=tests_src, - fork_name=LIGHTCLIENT_PATCH, - phase=PHASE0, + fork_name=fork_name, + phase=phase, + ) return gen_typing.TestProvider(prepare=prepare_fn, make_cases=cases_fn) @@ -33,6 +34,6 @@ def create_provider(tests_src, config_name: str) -> gen_typing.TestProvider: if __name__ == "__main__": gen_runner.run_generator("forks", [ - create_provider(test_altair_forks, MINIMAL), - create_provider(test_altair_forks, MAINNET), + create_provider(test_altair_forks, MINIMAL, PHASE0, LIGHTCLIENT_PATCH), + create_provider(test_altair_forks, MAINNET, PHASE0, LIGHTCLIENT_PATCH), ])