Update validator_client for BeaconStateTypes

This commit is contained in:
Paul Hauner 2019-05-09 12:19:52 +10:00
parent 49c92ef167
commit 0ac278f44d
No known key found for this signature in database
GPG Key ID: D362883A9218FCC6
2 changed files with 9 additions and 6 deletions

View File

@ -236,7 +236,7 @@ mod test {
#[test]
fn ssz_encoding() {
let original = PubsubMessage::Block(BeaconBlock::empty(&ChainSpec::foundation()));
let original = PubsubMessage::Block(BeaconBlock::empty(&FoundationStateTypes::spec()));
let encoded = ssz_encode(&original);

View File

@ -6,7 +6,10 @@ use std::fs;
use std::fs::File;
use std::io::{Error, ErrorKind};
use std::path::PathBuf;
use types::ChainSpec;
use types::{
BeaconStateTypes, ChainSpec, FewValidatorsStateTypes, FoundationStateTypes,
LighthouseTestnetStateTypes,
};
/// Stores the core configuration for this validator instance.
#[derive(Clone)]
@ -31,7 +34,7 @@ impl Default for Config {
let server = "localhost:5051".to_string();
let spec = ChainSpec::foundation();
let spec = FoundationStateTypes::spec();
Self {
data_dir,
@ -65,9 +68,9 @@ impl Config {
if let Some(spec_str) = args.value_of("spec") {
info!(log, "Using custom spec: {:?}", spec_str);
config.spec = match spec_str {
"foundation" => ChainSpec::foundation(),
"few_validators" => ChainSpec::few_validators(),
"lighthouse_testnet" => ChainSpec::lighthouse_testnet(),
"foundation" => FoundationStateTypes::spec(),
"few_validators" => FewValidatorsStateTypes::spec(),
"lighthouse_testnet" => LighthouseTestnetStateTypes::spec(),
// Should be impossible due to clap's `possible_values(..)` function.
_ => unreachable!(),
};