Skip to content

Commit

Permalink
Address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
elizabethengelman committed Dec 9, 2024
1 parent 42f3f96 commit bf647a6
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions cmd/soroban-cli/src/config/locator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,18 +262,20 @@ impl Args {
}

pub fn remove_identity(&self, name: &str, global_args: &global::Args) -> Result<(), Error> {
let printer = Print::new(global_args.quiet);
let print = Print::new(global_args.quiet);
let identity = self.read_identity(name)?;
if let Secret::SecureStore { entry_name } = identity {
let entry = StellarEntry::new(&entry_name)?;
match entry.delete_password() {
Ok(()) => {}
Err(e) if e.to_string() == keyring::Error::NoEntry.to_string() => {
printer.infoln("This key was already removed from the secure store. Removing the cli config file.");
}
Err(e) => {
return Err(Error::Keyring(e));
}
Err(e) => match e {
signer::keyring::Error::Keyring(keyring::Error::NoEntry) => {
print.infoln("This key was already removed from the secure store. Removing the cli config file.");
}
_ => {
return Err(Error::Keyring(e));
}
},
}
}

Expand Down

0 comments on commit bf647a6

Please sign in to comment.