Skip to content

Commit

Permalink
Merge branch 'feat/os_keychain' into feat/os-keychain-followup
Browse files Browse the repository at this point in the history
  • Loading branch information
elizabethengelman committed Dec 23, 2024
2 parents 78d59f1 + 01c8753 commit b5ea7de
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cmd/soroban-cli/src/commands/keys/address.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use clap::arg;

use crate::commands::config::{address, locator, secret};
use crate::{
commands::config::{address, locator, secret},
config::UnresolvedMuxedAccount,
};

#[derive(thiserror::Error, Debug)]
pub enum Error {
Expand Down Expand Up @@ -47,6 +50,11 @@ impl Cmd {
pub fn public_key(&self) -> Result<stellar_strkey::ed25519::PublicKey, Error> {
if let Ok(key) = stellar_strkey::ed25519::PublicKey::from_string(&self.name) {
Ok(key)
} else if let Ok(unresolved) = self.name.parse::<UnresolvedMuxedAccount>() {
let muxed = unresolved.resolve_muxed_account(&self.locator, self.hd_path)?;
Ok(stellar_strkey::ed25519::PublicKey::from_string(
&muxed.to_string(),
)?)
} else {
Ok(stellar_strkey::ed25519::PublicKey::from_payload(
self.private_key()?.verifying_key().as_bytes(),
Expand Down

0 comments on commit b5ea7de

Please sign in to comment.