Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 08be33a

Browse files
committed
remove instances of is_valid_pubkey
1 parent 1256438 commit 08be33a

File tree

4 files changed

+228
-193
lines changed

4 files changed

+228
-193
lines changed

token/cli/src/bench.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
use {
33
crate::{clap_app::Error, command::CommandResult, config::Config},
44
clap::ArgMatches,
5-
solana_clap_v3_utils::input_parsers::{pubkey_of_signer, Amount},
5+
solana_clap_v3_utils::input_parsers::{pubkey_of_signer, signer::SignerSource, Amount},
66
solana_client::{
77
nonblocking::rpc_client::RpcClient, rpc_client::RpcClient as BlockingRpcClient,
88
tpu_client::TpuClient, tpu_client::TpuClientConfig,
@@ -31,7 +31,7 @@ pub(crate) async fn bench_process_command(
3131

3232
match matches.subcommand() {
3333
Some(("create-accounts", arg_matches)) => {
34-
let token = pubkey_of_signer(arg_matches, "token", wallet_manager)
34+
let token = SignerSource::try_get_pubkey(arg_matches, "token", wallet_manager)
3535
.unwrap()
3636
.unwrap();
3737
let n = *arg_matches.get_one::<usize>("n").unwrap();
@@ -43,7 +43,7 @@ pub(crate) async fn bench_process_command(
4343
command_create_accounts(config, signers, &token, n, &owner).await?;
4444
}
4545
Some(("close-accounts", arg_matches)) => {
46-
let token = pubkey_of_signer(arg_matches, "token", wallet_manager)
46+
let token = SignerSource::try_get_pubkey(arg_matches, "token", wallet_manager)
4747
.unwrap()
4848
.unwrap();
4949
let n = *arg_matches.get_one::<usize>("n").unwrap();
@@ -54,30 +54,30 @@ pub(crate) async fn bench_process_command(
5454
command_close_accounts(config, signers, &token, n, &owner).await?;
5555
}
5656
Some(("deposit-into", arg_matches)) => {
57-
let token = pubkey_of_signer(arg_matches, "token", wallet_manager)
57+
let token = SignerSource::try_get_pubkey(arg_matches, "token", wallet_manager)
5858
.unwrap()
5959
.unwrap();
6060
let n = *arg_matches.get_one::<usize>("n").unwrap();
6161
let ui_amount = *arg_matches.get_one::<Amount>("amount").unwrap();
6262
let (owner_signer, owner) =
6363
config.signer_or_default(arg_matches, "owner", wallet_manager);
6464
signers.push(owner_signer);
65-
let from = pubkey_of_signer(arg_matches, "from", wallet_manager).unwrap();
65+
let from = SignerSource::try_get_pubkey(arg_matches, "from", wallet_manager).unwrap();
6666
command_deposit_into_or_withdraw_from(
6767
config, signers, &token, n, &owner, ui_amount, from, true,
6868
)
6969
.await?;
7070
}
7171
Some(("withdraw-from", arg_matches)) => {
72-
let token = pubkey_of_signer(arg_matches, "token", wallet_manager)
72+
let token = SignerSource::try_get_pubkey(arg_matches, "token", wallet_manager)
7373
.unwrap()
7474
.unwrap();
7575
let n = *arg_matches.get_one::<usize>("n").unwrap();
7676
let ui_amount = *arg_matches.get_one::<Amount>("amount").unwrap();
7777
let (owner_signer, owner) =
7878
config.signer_or_default(arg_matches, "owner", wallet_manager);
7979
signers.push(owner_signer);
80-
let to = pubkey_of_signer(arg_matches, "to", wallet_manager).unwrap();
80+
let to = SignerSource::try_get_pubkey(arg_matches, "to", wallet_manager).unwrap();
8181
command_deposit_into_or_withdraw_from(
8282
config, signers, &token, n, &owner, ui_amount, to, false,
8383
)

0 commit comments

Comments
 (0)