Skip to content

Commit

Permalink
fix: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
willemneal committed Jan 7, 2025
1 parent aecc5ac commit 63f247e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 25 deletions.
7 changes: 1 addition & 6 deletions cmd/soroban-cli/src/commands/contract/arg_parsing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ use crate::xdr::{

use crate::commands::txn_result::TxnResult;
use crate::config::{
self, address,
self,
sc_address::{self, UnresolvedScAddress},
secret,
};
use soroban_spec_tools::Spec;

Expand All @@ -42,10 +41,6 @@ pub enum Error {
Xdr(#[from] xdr::Error),
#[error(transparent)]
StrVal(#[from] soroban_spec_tools::Error),
#[error(transparent)]
Address(#[from] address::Error),
#[error(transparent)]
Secret(#[from] secret::Error),
#[error("Missing argument {0}")]
MissingArgument(String),
#[error("")]
Expand Down
8 changes: 2 additions & 6 deletions cmd/soroban-cli/src/commands/keys/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@ use clap::command;

use crate::{
commands::global,
config::{
address::{self, KeyName},
locator, secret,
},
config::{address::KeyName, locator, secret},
print::Print,
};

#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error(transparent)]
Secret(#[from] secret::Error),

#[error(transparent)]
Config(#[from] locator::Error),
#[error(transparent)]
Address(#[from] address::Error),
}

#[derive(Debug, clap::Parser, Clone)]
Expand Down
11 changes: 1 addition & 10 deletions cmd/soroban-cli/src/commands/keys/address.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
use clap::arg;

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

#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error(transparent)]
Config(#[from] locator::Error),

#[error(transparent)]
Secret(#[from] secret::Error),

#[error(transparent)]
StrKey(#[from] stellar_strkey::DecodeError),

#[error(transparent)]
Address(#[from] address::Error),
}
Expand Down
8 changes: 5 additions & 3 deletions cmd/soroban-cli/src/config/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ impl UnresolvedMuxedAccount {
) -> Result<xdr::MuxedAccount, Error> {
match self {
UnresolvedMuxedAccount::Resolved(muxed_account) => Ok(muxed_account.clone()),
UnresolvedMuxedAccount::AliasOrSecret(alias) => {
Self::resolve_muxed_account_with_alias(alias, locator, hd_path)
UnresolvedMuxedAccount::AliasOrSecret(alias_or_secret) => {
Self::resolve_muxed_account_with_alias(alias_or_secret, locator, hd_path)
}
}
}
Expand All @@ -78,7 +78,9 @@ impl UnresolvedMuxedAccount {
UnresolvedMuxedAccount::Resolved(muxed_account) => {
Err(Error::CannotSign(muxed_account.clone()))
}
UnresolvedMuxedAccount::AliasOrSecret(alias) => Ok(locator.key(alias)?),
UnresolvedMuxedAccount::AliasOrSecret(alias_or_secret) => {
Ok(locator.key(alias_or_secret)?)
}
}
}
}
Expand Down

0 comments on commit 63f247e

Please sign in to comment.