Skip to content

Commit

Permalink
fix: refactor with renames from PR
Browse files Browse the repository at this point in the history
  • Loading branch information
willemneal committed Dec 13, 2024
1 parent d4ba93d commit 318f579
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/commands/tx/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl Args {
op_source: Option<&address::Address>,
) -> Result<xdr::TransactionEnvelope, Error> {
let source_account = op_source
.map(|a| self.reslove_muxed_address(a))
.map(|a| self.resolve_muxed_address(a))
.transpose()?;
let op = xdr::Operation {
source_account,
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/commands/tx/new/account_merge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl TryFrom<&Cmd> for xdr::OperationBody {
type Error = tx::args::Error;
fn try_from(cmd: &Cmd) -> Result<Self, Self::Error> {
Ok(xdr::OperationBody::AccountMerge(
cmd.tx.reslove_muxed_address(&cmd.op.account)?,
cmd.tx.resolve_muxed_address(&cmd.op.account)?,
))
}
}
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/commands/tx/new/create_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl TryFrom<&Cmd> for xdr::OperationBody {
type Error = tx::args::Error;
fn try_from(cmd: &Cmd) -> Result<Self, Self::Error> {
Ok(xdr::OperationBody::CreateAccount(xdr::CreateAccountOp {
destination: cmd.tx.reslove_account_id(&cmd.op.destination)?,
destination: cmd.tx.resolve_account_id(&cmd.op.destination)?,
starting_balance: cmd.op.starting_balance.into(),
}))
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/commands/tx/new/payment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl TryFrom<&Cmd> for xdr::OperationBody {
type Error = tx::args::Error;
fn try_from(cmd: &Cmd) -> Result<Self, Self::Error> {
Ok(xdr::OperationBody::Payment(xdr::PaymentOp {
destination: cmd.tx.reslove_muxed_address(&cmd.op.destination)?,
destination: cmd.tx.resolve_muxed_address(&cmd.op.destination)?,
asset: cmd.op.asset.clone().into(),
amount: cmd.op.amount.into(),
}))
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/commands/tx/new/set_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ impl TryFrom<&Cmd> for xdr::OperationBody {
let inflation_dest: Option<xdr::AccountId> = cmd
.inflation_dest
.as_ref()
.map(|dest| tx.reslove_account_id(dest))
.map(|dest| tx.resolve_account_id(dest))
.transpose()?;
Ok(xdr::OperationBody::SetOptions(xdr::SetOptionsOp {
inflation_dest,
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/commands/tx/new/set_trustline_flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl TryFrom<&Cmd> for xdr::OperationBody {

Ok(xdr::OperationBody::SetTrustLineFlags(
xdr::SetTrustLineFlagsOp {
trustor: cmd.tx.reslove_account_id(&cmd.op.trustor)?,
trustor: cmd.tx.resolve_account_id(&cmd.op.trustor)?,
asset: cmd.op.asset.clone().into(),
clear_flags,
set_flags,
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/config/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl Address {

pub fn resolve_secret(&self, locator: &locator::Args) -> Result<secret::Secret, Error> {
match &self {
Address::AliasOrSecret(alias) => Ok(locator.get_private_key(alias)?),
Address::AliasOrSecret(alias) => Ok(locator.get_secret_key(alias)?),
Address::MuxedAccount(muxed_account) => Err(Error::CannotSign(muxed_account.clone())),
}
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/config/locator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ impl Args {
}

pub fn write_key(&self, name: &str, key: &Key) -> Result<(), Error> {
KeyType::Identity.write(name, public_key, &self.config_dir()?)
KeyType::Identity.write(name, key, &self.config_dir()?)
}

pub fn write_network(&self, name: &str, network: &Network) -> Result<(), Error> {
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/config/sign_with.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl Args {
}
} else {
let key_or_name = self.sign_with_key.as_deref().ok_or(Error::NoSignWithKey)?;
let secret = locator.get_private_key(key_or_name)?;
let secret = locator.get_secret_key(key_or_name)?;
secret.signer(self.hd_path, print)?
};
Ok(signer.sign_tx_env(tx, network)?)
Expand Down

0 comments on commit 318f579

Please sign in to comment.