Skip to content

Commit

Permalink
Return error when trying to get Secure Store or Ledger secret
Browse files Browse the repository at this point in the history
  • Loading branch information
elizabethengelman committed Dec 2, 2024
1 parent 9391731 commit a6756f1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cmd/soroban-cli/src/config/secret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ pub enum Error {
LedgerDoesNotRevealSecretKey,
#[error(transparent)]
Keyring(#[from] keyring::Error),
#[error("Secure Store does not reveal secret key")]
SecureStoreDoesNotRevealSecretKey,
}

#[derive(Debug, clap::Args, Clone)]
Expand Down Expand Up @@ -129,8 +131,12 @@ impl Secret {
.private()
.0,
)?,
Secret::Ledger => panic!("Ledger does not reveal secret key"),
Secret::SecureStore { .. } => panic!("Secure Store does not reveal secret key"),
Secret::Ledger => {
return Err(Error::LedgerDoesNotRevealSecretKey);
}
Secret::SecureStore { .. } => {
return Err(Error::SecureStoreDoesNotRevealSecretKey);
}
})
}

Expand Down

0 comments on commit a6756f1

Please sign in to comment.