validator_client: added default_value for spec; used unreachable macro for custom spec (lighthouse-252)

This commit is contained in:
thojest 2019-03-03 14:15:00 +01:00
parent 0b24a47b53
commit c28c07c17d

View File

@ -50,7 +50,8 @@ fn main() {
.short("s") .short("s")
.help("Configuration of Beacon Chain") .help("Configuration of Beacon Chain")
.takes_value(true) .takes_value(true)
.possible_values(&["foundation", "few_validators"]), .possible_values(&["foundation", "few_validators"])
.default_value("foundation"),
) )
.get_matches(); .get_matches();
@ -77,11 +78,8 @@ fn main() {
match spec_str { match spec_str {
"foundation" => config.spec = ChainSpec::foundation(), "foundation" => config.spec = ChainSpec::foundation(),
"few_validators" => config.spec = ChainSpec::few_validators(), "few_validators" => config.spec = ChainSpec::few_validators(),
// Should be impossible // Should be impossible due to clap's `possible_values(..)` function.
_ => { _ => unreachable!(),
error!(log, "Invalid ChainSpec defined"; "spec" => spec_str);
return;
}
}; };
} }