From 0ac278f44db91b1467a275a28e10e1da2b4d86e4 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Thu, 9 May 2019 12:19:52 +1000 Subject: [PATCH] Update `validator_client` for `BeaconStateTypes` --- beacon_node/eth2-libp2p/src/behaviour.rs | 2 +- validator_client/src/config.rs | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/beacon_node/eth2-libp2p/src/behaviour.rs b/beacon_node/eth2-libp2p/src/behaviour.rs index e1112e6ff9..f8a0a72494 100644 --- a/beacon_node/eth2-libp2p/src/behaviour.rs +++ b/beacon_node/eth2-libp2p/src/behaviour.rs @@ -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); diff --git a/validator_client/src/config.rs b/validator_client/src/config.rs index 903da047e7..66e9f2391f 100644 --- a/validator_client/src/config.rs +++ b/validator_client/src/config.rs @@ -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!(), };