From 5c5e64127e499eb82675fff25de9bea859e17604 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Thu, 20 Jun 2024 16:52:25 -0400 Subject: [PATCH] fix: rename sign_with_local_key to sign --- cmd/soroban-cli/src/commands/config/mod.rs | 6 +++--- cmd/soroban-cli/src/commands/contract/deploy/asset.rs | 2 +- cmd/soroban-cli/src/commands/contract/deploy/wasm.rs | 2 +- cmd/soroban-cli/src/commands/contract/extend.rs | 2 +- cmd/soroban-cli/src/commands/contract/install.rs | 2 +- cmd/soroban-cli/src/commands/contract/invoke.rs | 2 +- cmd/soroban-cli/src/commands/contract/restore.rs | 2 +- cmd/soroban-cli/src/commands/tx/sign.rs | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmd/soroban-cli/src/commands/config/mod.rs b/cmd/soroban-cli/src/commands/config/mod.rs index c193556e3..a238c5cd7 100644 --- a/cmd/soroban-cli/src/commands/config/mod.rs +++ b/cmd/soroban-cli/src/commands/config/mod.rs @@ -73,12 +73,12 @@ impl Args { Ok(self.signer()?.get_public_key().await?) } - pub async fn sign_with_local_key(&self, tx: Transaction) -> Result { + pub async fn sign(&self, tx: Transaction) -> Result { let signer = self.signer()?; - self.sign(&signer, tx).await + self.sign_with_signer(&signer, tx).await } - pub async fn sign( + pub async fn sign_with_signer( &self, signer: &impl Stellar, tx: Transaction, diff --git a/cmd/soroban-cli/src/commands/contract/deploy/asset.rs b/cmd/soroban-cli/src/commands/contract/deploy/asset.rs index e912d2b98..ab46a911d 100644 --- a/cmd/soroban-cli/src/commands/contract/deploy/asset.rs +++ b/cmd/soroban-cli/src/commands/contract/deploy/asset.rs @@ -124,7 +124,7 @@ impl NetworkRunnable for Cmd { return Ok(TxnResult::Txn(txn)); } let get_txn_resp = client - .send_transaction_polling(&self.config.sign_with_local_key(txn).await?) + .send_transaction_polling(&self.config.sign(txn).await?) .await? .try_into()?; if args.map_or(true, |a| !a.no_cache) { diff --git a/cmd/soroban-cli/src/commands/contract/deploy/wasm.rs b/cmd/soroban-cli/src/commands/contract/deploy/wasm.rs index 342c668db..debb15d82 100644 --- a/cmd/soroban-cli/src/commands/contract/deploy/wasm.rs +++ b/cmd/soroban-cli/src/commands/contract/deploy/wasm.rs @@ -225,7 +225,7 @@ impl NetworkRunnable for Cmd { return Ok(TxnResult::Txn(txn)); } let get_txn_resp = client - .send_transaction_polling(&config.sign_with_local_key(txn).await?) + .send_transaction_polling(&config.sign(txn).await?) .await? .try_into()?; if global_args.map_or(true, |a| !a.no_cache) { diff --git a/cmd/soroban-cli/src/commands/contract/extend.rs b/cmd/soroban-cli/src/commands/contract/extend.rs index a6a0929eb..6be0c9910 100644 --- a/cmd/soroban-cli/src/commands/contract/extend.rs +++ b/cmd/soroban-cli/src/commands/contract/extend.rs @@ -177,7 +177,7 @@ impl NetworkRunnable for Cmd { .transaction() .clone(); let res = client - .send_transaction_polling(&config.sign_with_local_key(tx).await?) + .send_transaction_polling(&config.sign(tx).await?) .await?; if args.map_or(true, |a| !a.no_cache) { data::write(res.clone().try_into()?, &network.rpc_uri()?)?; diff --git a/cmd/soroban-cli/src/commands/contract/install.rs b/cmd/soroban-cli/src/commands/contract/install.rs index d7ebef16d..04d159e36 100644 --- a/cmd/soroban-cli/src/commands/contract/install.rs +++ b/cmd/soroban-cli/src/commands/contract/install.rs @@ -171,7 +171,7 @@ impl NetworkRunnable for Cmd { return Ok(TxnResult::Txn(txn)); } let txn_resp = client - .send_transaction_polling(&self.config.sign_with_local_key(txn).await?) + .send_transaction_polling(&self.config.sign(txn).await?) .await?; if args.map_or(true, |a| !a.no_cache) { data::write(txn_resp.clone().try_into().unwrap(), &network.rpc_uri()?)?; diff --git a/cmd/soroban-cli/src/commands/contract/invoke.rs b/cmd/soroban-cli/src/commands/contract/invoke.rs index 117e9be6d..9c4c653f6 100644 --- a/cmd/soroban-cli/src/commands/contract/invoke.rs +++ b/cmd/soroban-cli/src/commands/contract/invoke.rs @@ -399,7 +399,7 @@ impl NetworkRunnable for Cmd { } // log_auth_cost_and_footprint(resources(&txn)); let res = client - .send_transaction_polling(&config.sign_with_local_key(txn).await?) + .send_transaction_polling(&config.sign(txn).await?) .await?; if !no_cache { data::write(res.clone().try_into()?, &network.rpc_uri()?)?; diff --git a/cmd/soroban-cli/src/commands/contract/restore.rs b/cmd/soroban-cli/src/commands/contract/restore.rs index e38a45b31..6994deb89 100644 --- a/cmd/soroban-cli/src/commands/contract/restore.rs +++ b/cmd/soroban-cli/src/commands/contract/restore.rs @@ -174,7 +174,7 @@ impl NetworkRunnable for Cmd { return Ok(TxnResult::Txn(tx)); } let res = client - .send_transaction_polling(&config.sign_with_local_key(tx).await?) + .send_transaction_polling(&config.sign(tx).await?) .await?; if args.map_or(true, |a| !a.no_cache) { data::write(res.clone().try_into()?, &network.rpc_uri()?)?; diff --git a/cmd/soroban-cli/src/commands/tx/sign.rs b/cmd/soroban-cli/src/commands/tx/sign.rs index da48182a4..6858106ce 100644 --- a/cmd/soroban-cli/src/commands/tx/sign.rs +++ b/cmd/soroban-cli/src/commands/tx/sign.rs @@ -31,6 +31,6 @@ impl Cmd { } pub async fn sign(&self, tx: Transaction) -> Result { - Ok(self.config.sign_with_local_key(tx).await?) + Ok(self.config.sign(tx).await?) } }