From a6a61aa3deacf396c0bac21e3028684a4736eab5 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 25 Sep 2024 10:22:14 +1000 Subject: [PATCH] remove unnecessary pub, clone, and qualifier --- cmd/soroban-cli/src/signer.rs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/cmd/soroban-cli/src/signer.rs b/cmd/soroban-cli/src/signer.rs index a5a50168c..c25d582b9 100644 --- a/cmd/soroban-cli/src/signer.rs +++ b/cmd/soroban-cli/src/signer.rs @@ -270,24 +270,23 @@ impl LocalKey { pub struct Lab; impl Lab { - pub const URL: &str = "https://lab.stellar.org/transaction/cli-sign"; + const URL: &str = "https://lab.stellar.org/transaction/cli-sign"; pub fn sign_tx_env( tx_env: &TransactionEnvelope, network: &Network, - printer: &crate::print::Print, + printer: &Print, ) -> Result { - let passphrase = network.network_passphrase.clone(); - let xdr_buffer: String = tx_env.to_xdr_base64(Limits::none())?; + let xdr = tx_env.to_xdr_base64(Limits::none())?; + let mut url = url::Url::parse(Self::URL)?; url.query_pairs_mut() - .append_pair("networkPassphrase", &passphrase) - .append_pair("xdr", &xdr_buffer); - - let txn_sign_url = url.to_string(); + .append_pair("networkPassphrase", &network.network_passphrase) + .append_pair("xdr", &xdr); + let url = url.to_string(); - printer.globeln(format!("Opening lab to sign transaction: {txn_sign_url}")); - open::that(txn_sign_url)?; + printer.globeln(format!("Opening lab to sign transaction: {url}")); + open::that(url)?; Err(Error::ReturningSignatureFromLab) }