mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Unify EthSpecs in Mainnet and Minimal
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
use crate::case_result::CaseResult;
|
||||
use crate::cases::*;
|
||||
use crate::doc_header::DocHeader;
|
||||
use crate::eth_specs::{MainnetEthSpec, MinimalEthSpec};
|
||||
use crate::yaml_decode::{yaml_split_header_and_cases, YamlDecode};
|
||||
use crate::EfTest;
|
||||
use serde_derive::Deserialize;
|
||||
use std::{fs::File, io::prelude::*, path::PathBuf};
|
||||
use types::{MainnetEthSpec, MinimalEthSpec};
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub struct Doc {
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use types::{
|
||||
typenum::{U0, U64, U8},
|
||||
ChainSpec, EthSpec, FewValidatorsEthSpec, FoundationEthSpec,
|
||||
};
|
||||
|
||||
/// "Minimal" testing specification, as defined here:
|
||||
///
|
||||
/// https://github.com/ethereum/eth2.0-specs/blob/v0.6.1/configs/constant_presets/minimal.yaml
|
||||
///
|
||||
/// Spec v0.6.1
|
||||
#[derive(Clone, PartialEq, Debug, Default, Serialize, Deserialize)]
|
||||
pub struct MinimalEthSpec;
|
||||
|
||||
impl EthSpec for MinimalEthSpec {
|
||||
type ShardCount = U8;
|
||||
type SlotsPerHistoricalRoot = U64;
|
||||
type LatestRandaoMixesLength = U64;
|
||||
type LatestActiveIndexRootsLength = U64;
|
||||
type LatestSlashedExitLength = U64;
|
||||
type SlotsPerEpoch = U8;
|
||||
type GenesisEpoch = U0;
|
||||
|
||||
fn default_spec() -> ChainSpec {
|
||||
// TODO: this spec is likely incorrect!
|
||||
let mut spec = FewValidatorsEthSpec::default_spec();
|
||||
spec.shuffle_round_count = 10;
|
||||
spec
|
||||
}
|
||||
}
|
||||
|
||||
pub type MainnetEthSpec = FoundationEthSpec;
|
||||
@@ -11,7 +11,6 @@ mod cases;
|
||||
mod doc;
|
||||
mod doc_header;
|
||||
mod error;
|
||||
mod eth_specs;
|
||||
mod yaml_decode;
|
||||
|
||||
/// Defined where an object can return the results of some test(s) adhering to the Ethereum
|
||||
|
||||
Reference in New Issue
Block a user