mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-16 11:22:56 +00:00
Avoid pulling env into blocking context
This commit is contained in:
@@ -3,8 +3,7 @@ pub mod create_validators;
|
||||
pub mod import_validators;
|
||||
|
||||
use clap::{App, ArgMatches};
|
||||
use environment::Environment;
|
||||
use types::EthSpec;
|
||||
use types::ChainSpec;
|
||||
|
||||
pub const CMD: &str = "validators";
|
||||
|
||||
@@ -15,14 +14,9 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
||||
.subcommand(import_validators::cli_app())
|
||||
}
|
||||
|
||||
pub async fn cli_run<'a, T: EthSpec>(
|
||||
matches: &'a ArgMatches<'a>,
|
||||
env: Environment<T>,
|
||||
) -> Result<(), String> {
|
||||
pub async fn cli_run<'a>(matches: &'a ArgMatches<'a>, spec: &ChainSpec) -> Result<(), String> {
|
||||
match matches.subcommand() {
|
||||
(create_validators::CMD, Some(matches)) => {
|
||||
create_validators::cli_run::<T>(matches, env).await
|
||||
}
|
||||
(create_validators::CMD, Some(matches)) => create_validators::cli_run(matches, spec).await,
|
||||
(import_validators::CMD, Some(matches)) => import_validators::cli_run(matches).await,
|
||||
(unknown, _) => Err(format!(
|
||||
"{} does not have a {} command. See --help",
|
||||
|
||||
Reference in New Issue
Block a user