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.
This commit is contained in:
Michael Sproul 2020-07-26 23:19:49 +00:00
parent 0b5be9b2c0
commit 5f013548c0
3 changed files with 29 additions and 3 deletions

View File

@ -1,4 +1,4 @@
TESTS_TAG := v0.12.1 TESTS_TAG := v0.12.2
TESTS = general minimal mainnet TESTS = general minimal mainnet
TARBALLS = $(patsubst %,%-$(TESTS_TAG).tar.gz,$(TESTS)) TARBALLS = $(patsubst %,%-$(TESTS_TAG).tar.gz,$(TESTS))

View File

@ -207,6 +207,25 @@ impl<E: EthSpec + TypeName, T: EpochTransition<E>> Handler for EpochProcessingHa
} }
} }
pub struct FinalityHandler<E>(PhantomData<E>);
impl<E: EthSpec + TypeName> Handler for FinalityHandler<E> {
// Reuse the blocks case runner.
type Case = cases::SanityBlocks<E>;
fn config_name() -> &'static str {
E::name()
}
fn runner_name() -> &'static str {
"finality"
}
fn handler_name() -> String {
"finality".into()
}
}
pub struct GenesisValidityHandler<E>(PhantomData<E>); pub struct GenesisValidityHandler<E>(PhantomData<E>);
impl<E: EthSpec + TypeName> Handler for GenesisValidityHandler<E> { impl<E: EthSpec + TypeName> Handler for GenesisValidityHandler<E> {

View File

@ -10,7 +10,8 @@ fn config_test<E: EthSpec + TypeName>() {
.join("eth2.0-spec-tests") .join("eth2.0-spec-tests")
.join("tests") .join("tests")
.join(E::name()) .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 yaml_config = YamlConfig::from_file(&config_path).expect("config file loads OK");
let spec = E::default_spec(); let spec = E::default_spec();
let yaml_from_spec = YamlConfig::from_spec::<E>(&spec); let yaml_from_spec = YamlConfig::from_spec::<E>(&spec);
@ -233,8 +234,14 @@ fn epoch_processing_slashings() {
#[test] #[test]
fn epoch_processing_final_updates() { fn epoch_processing_final_updates() {
EpochProcessingHandler::<MinimalEthSpec, FinalUpdates>::run();
EpochProcessingHandler::<MainnetEthSpec, FinalUpdates>::run(); EpochProcessingHandler::<MainnetEthSpec, FinalUpdates>::run();
EpochProcessingHandler::<MainnetEthSpec, FinalUpdates>::run(); }
#[test]
fn finality() {
FinalityHandler::<MinimalEthSpec>::run();
FinalityHandler::<MainnetEthSpec>::run();
} }
#[test] #[test]