Skip to content

Commit

Permalink
refactor: renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexD10S committed Dec 14, 2024
1 parent 223a2fd commit 7b86924
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions crates/pop-cli/src/commands/call/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub struct CallChainCommand {
#[arg(short, long)]
suri: Option<String>,
/// Use your browser wallet to sign the extrinsic.
#[arg(name = "use-wallet", long, default_value = "false", conflicts_with = "suri")]
#[arg(name = "use-wallet", short('w'), long, default_value = "false", conflicts_with = "suri")]
use_wallet: bool,
/// SCALE encoded bytes representing the call data of the extrinsic.
#[arg(name = "call", short, long, conflicts_with_all = ["pallet", "function", "args"])]
Expand Down Expand Up @@ -103,8 +103,7 @@ impl CallChainCommand {
// Sign and submit the extrinsic.
let result = if self.use_wallet {
let call_data = xt.encode_call_data(&chain.client.metadata())?;
submit_extrinsic_with_secure_signing(&chain.client, &chain.url, call_data, &mut cli)
.await
submit_extrinsic_with_wallet(&chain.client, &chain.url, call_data, &mut cli).await
} else {
call.submit_extrinsic(&chain.client, &chain.url, xt, &mut cli).await
};
Expand Down Expand Up @@ -275,7 +274,7 @@ impl CallChainCommand {
if use_wallet {
let call_data_bytes =
decode_call_data(call_data).map_err(|err| anyhow!("{}", format!("{err:?}")))?;
submit_extrinsic_with_secure_signing(client, &url, call_data_bytes, cli)
submit_extrinsic_with_wallet(client, &url, call_data_bytes, cli)

Check warning on line 277 in crates/pop-cli/src/commands/call/chain.rs

View workflow job for this annotation

GitHub Actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler --> crates/pop-cli/src/commands/call/chain.rs:277:41 | 277 | submit_extrinsic_with_wallet(client, &url, call_data_bytes, cli) | ^^^^ help: change this to: `url` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `#[warn(clippy::needless_borrow)]` on by default
.await
.map_err(|err| anyhow!("{}", format!("{err:?}")))?;
display_message("Call complete.", true, cli)?;
Expand Down Expand Up @@ -482,7 +481,7 @@ impl Call {
}

// Sign and submit an extrinsic using wallet integration.
async fn submit_extrinsic_with_secure_signing(
async fn submit_extrinsic_with_wallet(
client: &OnlineClient<SubstrateConfig>,
url: &Url,
call_data: Vec<u8>,
Expand Down

0 comments on commit 7b86924

Please sign in to comment.