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

Commit 513c114

Browse files
authored
token-cli-bench: Remove RPC utils in favor of Tpu Client (#3046)
1 parent b425bae commit 513c114

File tree

3 files changed

+9
-196
lines changed

3 files changed

+9
-196
lines changed

token/cli/src/bench.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
use crate::CommandResult;
2-
31
/// The `bench` subcommand
42
use {
5-
crate::{
6-
config::Config, owner_address_arg,
7-
rpc_client_utils::send_and_confirm_messages_with_spinner, Error,
8-
},
3+
crate::{config::Config, owner_address_arg, CommandResult, Error},
94
clap::{value_t_or_exit, App, AppSettings, Arg, ArgMatches, SubCommand},
105
solana_clap_utils::{
116
input_parsers::pubkey_of_signer,
127
input_validators::{is_amount, is_parsable, is_valid_pubkey},
138
},
14-
solana_client::rpc_client::RpcClient,
9+
solana_client::{
10+
rpc_client::RpcClient,
11+
tpu_client::{TpuClient, TpuClientConfig},
12+
},
1513
solana_remote_wallet::remote_wallet::RemoteWalletManager,
1614
solana_sdk::{
1715
message::Message, native_token::Sol, program_pack::Pack, pubkey::Pubkey, signature::Signer,
@@ -461,12 +459,13 @@ fn send_messages(
461459
crate::check_fee_payer_balance(config, lamports_required)?;
462460

463461
let start = Instant::now();
464-
let transaction_errors = send_and_confirm_messages_with_spinner(
462+
let tpu_client = TpuClient::new(
465463
config.rpc_client.clone(),
466464
&config.websocket_url,
467-
messages,
468-
&signers,
465+
TpuClientConfig::default(),
469466
)?;
467+
let transaction_errors =
468+
tpu_client.send_and_confirm_messages_with_spinner(messages, &signers)?;
470469

471470
for (i, transaction_error) in transaction_errors.into_iter().enumerate() {
472471
if let Some(transaction_error) = transaction_error {

token/cli/src/main.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ use output::*;
6060
mod sort;
6161
use sort::sort_and_parse_token_accounts;
6262

63-
mod rpc_client_utils;
64-
6563
mod bench;
6664
use bench::*;
6765

token/cli/src/rpc_client_utils.rs

Lines changed: 0 additions & 184 deletions
This file was deleted.

0 commit comments

Comments
 (0)