From 5f013548c01a1bb14c3eeb1a3d0b422316586213 Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Sun, 26 Jul 2020 23:19:49 +0000 Subject: [PATCH] Update to EF tests v0.12.2 (#1392) Update the EF test vectors to v0.12.2 so that they include the new finality tests. Also, correct a typo that caused the epoch processing final update tests not to run on the minimal spec. --- testing/ef_tests/Makefile | 2 +- testing/ef_tests/src/handler.rs | 19 +++++++++++++++++++ testing/ef_tests/tests/tests.rs | 11 +++++++++-- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/testing/ef_tests/Makefile b/testing/ef_tests/Makefile index 0b9752b601..a8e6c73c09 100644 --- a/testing/ef_tests/Makefile +++ b/testing/ef_tests/Makefile @@ -1,4 +1,4 @@ -TESTS_TAG := v0.12.1 +TESTS_TAG := v0.12.2 TESTS = general minimal mainnet TARBALLS = $(patsubst %,%-$(TESTS_TAG).tar.gz,$(TESTS)) diff --git a/testing/ef_tests/src/handler.rs b/testing/ef_tests/src/handler.rs index 47fb207a50..2613c25b98 100644 --- a/testing/ef_tests/src/handler.rs +++ b/testing/ef_tests/src/handler.rs @@ -207,6 +207,25 @@ impl> Handler for EpochProcessingHa } } +pub struct FinalityHandler(PhantomData); + +impl Handler for FinalityHandler { + // Reuse the blocks case runner. + type Case = cases::SanityBlocks; + + fn config_name() -> &'static str { + E::name() + } + + fn runner_name() -> &'static str { + "finality" + } + + fn handler_name() -> String { + "finality".into() + } +} + pub struct GenesisValidityHandler(PhantomData); impl Handler for GenesisValidityHandler { diff --git a/testing/ef_tests/tests/tests.rs b/testing/ef_tests/tests/tests.rs index 99bbe2a865..149b2c059e 100644 --- a/testing/ef_tests/tests/tests.rs +++ b/testing/ef_tests/tests/tests.rs @@ -10,7 +10,8 @@ fn config_test() { .join("eth2.0-spec-tests") .join("tests") .join(E::name()) - .join("config.yaml"); + .join("config") + .join("phase0.yaml"); let yaml_config = YamlConfig::from_file(&config_path).expect("config file loads OK"); let spec = E::default_spec(); let yaml_from_spec = YamlConfig::from_spec::(&spec); @@ -233,8 +234,14 @@ fn epoch_processing_slashings() { #[test] fn epoch_processing_final_updates() { + EpochProcessingHandler::::run(); EpochProcessingHandler::::run(); - EpochProcessingHandler::::run(); +} + +#[test] +fn finality() { + FinalityHandler::::run(); + FinalityHandler::::run(); } #[test]