diff --git a/apps/fortuna/src/command/run.rs b/apps/fortuna/src/command/run.rs index 93d62561ad..234133fada 100644 --- a/apps/fortuna/src/command/run.rs +++ b/apps/fortuna/src/command/run.rs @@ -127,7 +127,6 @@ pub async fn run(opts: &RunOptions) -> Result<()> { .provider_config .as_ref() .map(|path| ProviderConfig::load(&path).expect("Failed to load provider config")); - let private_key = opts.load_private_key()?; let secret = opts.randomness.load_secret()?; let (tx_exit, rx_exit) = watch::channel(false); @@ -212,8 +211,8 @@ pub async fn run(opts: &RunOptions) -> Result<()> { Ok::<(), Error>(()) }); - if let Some(private_key) = private_key { - spawn(run_keeper(chains.clone(), config, private_key)); + if let Some(keeper_private_key) = opts.load_keeper_private_key()? { + spawn(run_keeper(chains.clone(), config, keeper_private_key)); } run_api(opts.addr.clone(), chains, rx_exit).await?; diff --git a/apps/fortuna/src/config/run.rs b/apps/fortuna/src/config/run.rs index f53836cbc4..c52e31682d 100644 --- a/apps/fortuna/src/config/run.rs +++ b/apps/fortuna/src/config/run.rs @@ -46,7 +46,7 @@ pub struct RunOptions { } impl RunOptions { - pub fn load_private_key(&self) -> Result> { + pub fn load_keeper_private_key(&self) -> Result> { if let Some(ref keeper_private_key_file) = self.keeper_private_key_file { return Ok(Some(fs::read_to_string(keeper_private_key_file)?)); }