Skip to content
Snippets Groups Projects
Commit dee394c8 authored by Wei Tang's avatar Wei Tang
Browse files

yamltests: pass all justification_and_finalization tests

parent 2ca82443
Branches
No related merge requests found
use serde_derive::{Serialize, Deserialize};
use beacon::types::BeaconState;
use beacon::Config;
use beacon::{BeaconState, Config};
use crate::{Test, run_test_with};
#[derive(Serialize, Deserialize, Debug)]
#[serde(deny_unknown_fields)]
pub struct CrosslinksTest {
pub struct JustificationAndFinalizationTest<C: Config> {
pub description: String,
pub pre: BeaconState,
pub post: Option<BeaconState>,
pub pre: BeaconState<C>,
pub post: Option<BeaconState<C>>,
}
impl Test for CrosslinksTest {
fn run<C: Config>(&self, config: &C) {
run_test_with(&self.description, &self.pre, self.post.as_ref(), config, |executive| {
executive.process_crosslinks()
impl<C: Config> Test for JustificationAndFinalizationTest<C> {
fn run(&self) {
run_test_with(&self.description, &self.pre, self.post.as_ref(), |state| {
state.process_justification_and_finalization()
});
}
}
#[derive(Serialize, Deserialize, Debug)]
#[serde(deny_unknown_fields)]
pub struct RegistryUpdatesTest {
pub description: String,
pub pre: BeaconState,
pub post: Option<BeaconState>,
}
// #[derive(Serialize, Deserialize, Debug)]
// #[serde(deny_unknown_fields)]
// pub struct CrosslinksTest {
// pub description: String,
// pub pre: BeaconState,
// pub post: Option<BeaconState>,
// }
impl Test for RegistryUpdatesTest {
fn run<C: Config>(&self, config: &C) {
run_test_with(&self.description, &self.pre, self.post.as_ref(), config, |executive| {
executive.process_registry_updates()
});
}
}
// impl Test for CrosslinksTest {
// fn run<C: Config>(&self, config: &C) {
// run_test_with(&self.description, &self.pre, self.post.as_ref(), config, |executive| {
// executive.process_crosslinks()
// });
// }
// }
// #[derive(Serialize, Deserialize, Debug)]
// #[serde(deny_unknown_fields)]
// pub struct RegistryUpdatesTest {
// pub description: String,
// pub pre: BeaconState,
// pub post: Option<BeaconState>,
// }
// impl Test for RegistryUpdatesTest {
// fn run<C: Config>(&self, config: &C) {
// run_test_with(&self.description, &self.pre, self.post.as_ref(), config, |executive| {
// executive.process_registry_updates()
// });
// }
// }
// mod epoch_processing;
mod epoch_processing;
mod operations;
// mod sanity;
// pub use epoch_processing::{CrosslinksTest, RegistryUpdatesTest};
pub use epoch_processing::*;
pub use operations::*;
// pub use sanity::{BlocksTest, SlotsTest};
......
......@@ -45,6 +45,7 @@ fn run_all<C: Config + serde::Serialize + DeserializeOwned>(runner: &str, file:
"proposer_slashing" => run::<ProposerSlashingTest<C>>(file),
"transfer" => run::<TransferTest<C>>(file),
"voluntary_exit" => run::<VoluntaryExitTest<C>>(file),
"justification_and_finalization" => run::<JustificationAndFinalizationTest<C>>(file),
// "crosslinks" => run::<CrosslinksTest, _>(file, &config),
// "registry_updates" => run::<RegistryUpdatesTest, _>(file, &config),
// "blocks" => run::<BlocksTest, _>(file, &config),
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment