diff --git a/Cargo.lock b/Cargo.lock index 503b2280d..df8f1e158 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5588,7 +5588,6 @@ dependencies = [ "solana-sdk", "solana-streamer", "solana-test-validator", - "solana-thin-client", "solana-tpu-client", "solana-transaction-status", "solana-version", diff --git a/bench-tps/Cargo.toml b/bench-tps/Cargo.toml index 2fc48c9e2..2c7060175 100644 --- a/bench-tps/Cargo.toml +++ b/bench-tps/Cargo.toml @@ -35,7 +35,6 @@ solana-rpc-client-nonce-utils = { workspace = true } solana-runtime = { workspace = true } solana-sdk = { workspace = true } solana-streamer = { workspace = true } -solana-thin-client = { workspace = true } solana-tpu-client = { workspace = true } solana-transaction-status = { workspace = true } solana-version = { workspace = true } diff --git a/bench-tps/src/bench_tps_client.rs b/bench-tps/src/bench_tps_client.rs index 0715d7398..173cdd7cc 100644 --- a/bench-tps/src/bench_tps_client.rs +++ b/bench-tps/src/bench_tps_client.rs @@ -113,5 +113,4 @@ pub trait BenchTpsClient { mod bank_client; mod rpc_client; -mod thin_client; mod tpu_client; diff --git a/bench-tps/src/bench_tps_client/thin_client.rs b/bench-tps/src/bench_tps_client/thin_client.rs deleted file mode 100644 index 22945c449..000000000 --- a/bench-tps/src/bench_tps_client/thin_client.rs +++ /dev/null @@ -1,143 +0,0 @@ -use { - crate::bench_tps_client::{BenchTpsClient, BenchTpsError, Result}, - solana_client::thin_client::ThinClient, - solana_rpc_client_api::config::RpcBlockConfig, - solana_sdk::{ - account::Account, - client::{AsyncClient, Client, SyncClient}, - commitment_config::CommitmentConfig, - epoch_info::EpochInfo, - hash::Hash, - message::Message, - pubkey::Pubkey, - signature::Signature, - slot_history::Slot, - transaction::Transaction, - }, - solana_transaction_status::UiConfirmedBlock, -}; - -impl BenchTpsClient for ThinClient { - fn send_transaction(&self, transaction: Transaction) -> Result { - AsyncClient::async_send_transaction(self, transaction).map_err(|err| err.into()) - } - fn send_batch(&self, transactions: Vec) -> Result<()> { - AsyncClient::async_send_batch(self, transactions).map_err(|err| err.into()) - } - fn get_latest_blockhash(&self) -> Result { - SyncClient::get_latest_blockhash(self).map_err(|err| err.into()) - } - - fn get_latest_blockhash_with_commitment( - &self, - commitment_config: CommitmentConfig, - ) -> Result<(Hash, u64)> { - SyncClient::get_latest_blockhash_with_commitment(self, commitment_config) - .map_err(|err| err.into()) - } - - fn get_transaction_count(&self) -> Result { - SyncClient::get_transaction_count(self).map_err(|err| err.into()) - } - - fn get_transaction_count_with_commitment( - &self, - commitment_config: CommitmentConfig, - ) -> Result { - SyncClient::get_transaction_count_with_commitment(self, commitment_config) - .map_err(|err| err.into()) - } - - fn get_epoch_info(&self) -> Result { - SyncClient::get_epoch_info(self).map_err(|err| err.into()) - } - - fn get_balance(&self, pubkey: &Pubkey) -> Result { - SyncClient::get_balance(self, pubkey).map_err(|err| err.into()) - } - - fn get_balance_with_commitment( - &self, - pubkey: &Pubkey, - commitment_config: CommitmentConfig, - ) -> Result { - SyncClient::get_balance_with_commitment(self, pubkey, commitment_config) - .map_err(|err| err.into()) - } - - fn get_fee_for_message(&self, message: &Message) -> Result { - SyncClient::get_fee_for_message(self, message).map_err(|err| err.into()) - } - - fn get_minimum_balance_for_rent_exemption(&self, data_len: usize) -> Result { - SyncClient::get_minimum_balance_for_rent_exemption(self, data_len).map_err(|err| err.into()) - } - - fn addr(&self) -> String { - Client::tpu_addr(self) - } - - fn request_airdrop_with_blockhash( - &self, - pubkey: &Pubkey, - lamports: u64, - recent_blockhash: &Hash, - ) -> Result { - self.rpc_client() - .request_airdrop_with_blockhash(pubkey, lamports, recent_blockhash) - .map_err(|err| err.into()) - } - - fn get_account(&self, pubkey: &Pubkey) -> Result { - self.rpc_client() - .get_account(pubkey) - .map_err(|err| err.into()) - } - - fn get_account_with_commitment( - &self, - pubkey: &Pubkey, - commitment_config: CommitmentConfig, - ) -> Result { - SyncClient::get_account_with_commitment(self, pubkey, commitment_config) - .map_err(|err| err.into()) - .and_then(|account| { - account.ok_or_else(|| { - BenchTpsError::Custom(format!("AccountNotFound: pubkey={pubkey}")) - }) - }) - } - - fn get_multiple_accounts(&self, pubkeys: &[Pubkey]) -> Result>> { - self.rpc_client() - .get_multiple_accounts(pubkeys) - .map_err(|err| err.into()) - } - - fn get_slot_with_commitment(&self, commitment_config: CommitmentConfig) -> Result { - self.rpc_client() - .get_slot_with_commitment(commitment_config) - .map_err(|err| err.into()) - } - - fn get_blocks_with_commitment( - &self, - start_slot: Slot, - end_slot: Option, - commitment_config: CommitmentConfig, - ) -> Result> { - self.rpc_client() - .get_blocks_with_commitment(start_slot, end_slot, commitment_config) - .map_err(|err| err.into()) - } - - fn get_block_with_config( - &self, - slot: Slot, - rpc_block_config: RpcBlockConfig, - ) -> Result { - self.rpc_client() - .get_block_with_config(slot, rpc_block_config) - .map_err(|err| err.into()) - } -}