From 8732084a198d51f695e7b7768314dd4022a180e8 Mon Sep 17 00:00:00 2001 From: Elizabeth Engelman <4752801+elizabethengelman@users.noreply.github.com> Date: Mon, 2 Dec 2024 12:08:09 -0500 Subject: [PATCH] Return error when trying to get Secure Store secret --- cmd/soroban-cli/src/config/secret.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/soroban-cli/src/config/secret.rs b/cmd/soroban-cli/src/config/secret.rs index 1281688f9..aade738a9 100644 --- a/cmd/soroban-cli/src/config/secret.rs +++ b/cmd/soroban-cli/src/config/secret.rs @@ -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)] @@ -130,7 +132,9 @@ impl Secret { .0, )?, Secret::Ledger => panic!("Ledger does not reveal secret key"), - Secret::SecureStore { .. } => panic!("Secure Store does not reveal secret key"), + Secret::SecureStore { .. } => { + return Err(Error::SecureStoreDoesNotRevealSecretKey); + } }) }