From 8f457885ba1a270cddf537a491fcbf8d2eeb6e85 Mon Sep 17 00:00:00 2001 From: Tyera Eulberg Date: Mon, 22 Aug 2022 15:18:07 -0600 Subject: [PATCH] Remove unnecessary Client prefix --- client/src/client_error.rs | 4 +- rpc-client-api/src/client_error.rs | 64 ++-- rpc-client/src/nonblocking/rpc_client.rs | 418 +++++++++++----------- rpc-client/src/rpc_client.rs | 290 +++++++-------- tpu-client/src/nonblocking/quic_client.rs | 2 +- tpu-client/src/nonblocking/tpu_client.rs | 2 +- 6 files changed, 392 insertions(+), 388 deletions(-) diff --git a/client/src/client_error.rs b/client/src/client_error.rs index efd4482551a1c6..33538647aa66d7 100644 --- a/client/src/client_error.rs +++ b/client/src/client_error.rs @@ -1 +1,3 @@ -pub use solana_rpc_client_api::client_error::*; +pub use solana_rpc_client_api::client_error::{ + reqwest, Error as ClientError, ErrorKind as ClientErrorKind, Result, +}; diff --git a/rpc-client-api/src/client_error.rs b/rpc-client-api/src/client_error.rs index 084bb216ee2273..4c17dea8423026 100644 --- a/rpc-client-api/src/client_error.rs +++ b/rpc-client-api/src/client_error.rs @@ -5,11 +5,11 @@ use { signature::SignerError, transaction::TransactionError, transport::TransportError, }, std::io, - thiserror::Error, + thiserror::Error as ThisError, }; -#[derive(Error, Debug)] -pub enum ClientErrorKind { +#[derive(ThisError, Debug)] +pub enum ErrorKind { #[error(transparent)] Io(#[from] io::Error), #[error(transparent)] @@ -26,7 +26,7 @@ pub enum ClientErrorKind { Custom(String), } -impl ClientErrorKind { +impl ErrorKind { pub fn get_transaction_error(&self) -> Option { match self { Self::RpcError(request::RpcError::RpcResponseError { @@ -44,7 +44,7 @@ impl ClientErrorKind { } } -impl From for ClientErrorKind { +impl From for ErrorKind { fn from(err: TransportError) -> Self { match err { TransportError::IoError(err) => Self::Io(err), @@ -54,31 +54,31 @@ impl From for ClientErrorKind { } } -impl From for TransportError { - fn from(client_error_kind: ClientErrorKind) -> Self { +impl From for TransportError { + fn from(client_error_kind: ErrorKind) -> Self { match client_error_kind { - ClientErrorKind::Io(err) => Self::IoError(err), - ClientErrorKind::TransactionError(err) => Self::TransactionError(err), - ClientErrorKind::Reqwest(err) => Self::Custom(format!("{:?}", err)), - ClientErrorKind::RpcError(err) => Self::Custom(format!("{:?}", err)), - ClientErrorKind::SerdeJson(err) => Self::Custom(format!("{:?}", err)), - ClientErrorKind::SigningError(err) => Self::Custom(format!("{:?}", err)), - ClientErrorKind::Custom(err) => Self::Custom(format!("{:?}", err)), + ErrorKind::Io(err) => Self::IoError(err), + ErrorKind::TransactionError(err) => Self::TransactionError(err), + ErrorKind::Reqwest(err) => Self::Custom(format!("{:?}", err)), + ErrorKind::RpcError(err) => Self::Custom(format!("{:?}", err)), + ErrorKind::SerdeJson(err) => Self::Custom(format!("{:?}", err)), + ErrorKind::SigningError(err) => Self::Custom(format!("{:?}", err)), + ErrorKind::Custom(err) => Self::Custom(format!("{:?}", err)), } } } -#[derive(Error, Debug)] +#[derive(ThisError, Debug)] #[error("{kind}")] -pub struct ClientError { +pub struct Error { pub request: Option, #[source] - pub kind: ClientErrorKind, + pub kind: ErrorKind, } -impl ClientError { - pub fn new_with_request(kind: ClientErrorKind, request: request::RpcRequest) -> Self { +impl Error { + pub fn new_with_request(kind: ErrorKind, request: request::RpcRequest) -> Self { Self { request: Some(request), kind, @@ -96,7 +96,7 @@ impl ClientError { self.request.as_ref() } - pub fn kind(&self) -> &ClientErrorKind { + pub fn kind(&self) -> &ErrorKind { &self.kind } @@ -105,8 +105,8 @@ impl ClientError { } } -impl From for ClientError { - fn from(kind: ClientErrorKind) -> Self { +impl From for Error { + fn from(kind: ErrorKind) -> Self { Self { request: None, kind, @@ -114,7 +114,7 @@ impl From for ClientError { } } -impl From for ClientError { +impl From for Error { fn from(err: TransportError) -> Self { Self { request: None, @@ -123,13 +123,13 @@ impl From for ClientError { } } -impl From for TransportError { - fn from(client_error: ClientError) -> Self { +impl From for TransportError { + fn from(client_error: Error) -> Self { client_error.kind.into() } } -impl From for ClientError { +impl From for Error { fn from(err: std::io::Error) -> Self { Self { request: None, @@ -138,7 +138,7 @@ impl From for ClientError { } } -impl From for ClientError { +impl From for Error { fn from(err: reqwest::Error) -> Self { Self { request: None, @@ -147,7 +147,7 @@ impl From for ClientError { } } -impl From for ClientError { +impl From for Error { fn from(err: request::RpcError) -> Self { Self { request: None, @@ -156,7 +156,7 @@ impl From for ClientError { } } -impl From for ClientError { +impl From for Error { fn from(err: serde_json::error::Error) -> Self { Self { request: None, @@ -165,7 +165,7 @@ impl From for ClientError { } } -impl From for ClientError { +impl From for Error { fn from(err: SignerError) -> Self { Self { request: None, @@ -174,7 +174,7 @@ impl From for ClientError { } } -impl From for ClientError { +impl From for Error { fn from(err: TransactionError) -> Self { Self { request: None, @@ -183,4 +183,4 @@ impl From for ClientError { } } -pub type Result = std::result::Result; +pub type Result = std::result::Result; diff --git a/rpc-client/src/nonblocking/rpc_client.rs b/rpc-client/src/nonblocking/rpc_client.rs index 86ce16564fc37c..9e1a5c2b1888b2 100644 --- a/rpc-client/src/nonblocking/rpc_client.rs +++ b/rpc-client/src/nonblocking/rpc_client.rs @@ -28,7 +28,9 @@ use { UiAccount, UiAccountData, UiAccountEncoding, }, solana_rpc_client_api::{ - client_error::{ClientError, ClientErrorKind, Result as ClientResult}, + client_error::{ + Error as ClientError, ErrorKind as ClientErrorKind, Result as ClientResult, + }, config::{RpcAccountInfoConfig, *}, filter::{self, RpcFilterType}, request::{RpcError, RpcRequest, RpcResponseErrorData, TokenAccountsFilter}, @@ -118,7 +120,7 @@ use { /// /// ``` /// # use solana_sdk::system_transaction; -/// # use solana_rpc_client_api::client_error::ClientError; +/// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::signature::{Keypair, Signer}; /// # use solana_sdk::hash::Hash; @@ -130,7 +132,7 @@ use { /// # let tx = system_transaction::transfer(&key, &to, lamports, latest_blockhash); /// let signature = rpc_client.send_transaction(&tx)?; /// let statuses = rpc_client.get_signature_statuses(&[signature])?.value; -/// # Ok::<(), ClientError>(()) +/// # Ok::<(), Error>(()) /// ``` /// /// Requests may timeout, in which case they return a [`ClientError`] where the @@ -634,7 +636,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::{ /// # signature::Signer, @@ -650,9 +652,9 @@ impl RpcClient { /// # let latest_blockhash = rpc_client.get_latest_blockhash().await?; /// let tx = system_transaction::transfer(&alice, &bob.pubkey(), lamports, latest_blockhash); /// let signature = rpc_client.send_and_confirm_transaction(&tx).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn send_and_confirm_transaction( &self, @@ -802,7 +804,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::{ /// # signature::Signer, @@ -820,9 +822,9 @@ impl RpcClient { /// let latest_blockhash = rpc_client.get_latest_blockhash().await?; /// let tx = system_transaction::transfer(&alice, &bob.pubkey(), lamports, latest_blockhash); /// let signature = rpc_client.send_transaction(&tx).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn send_transaction(&self, transaction: &Transaction) -> ClientResult { self.send_transaction_with_config( @@ -889,7 +891,7 @@ impl RpcClient { /// /// ``` /// # use solana_rpc_client_api::{ - /// # client_error::ClientError, + /// # client_error::Error, /// # config::RpcSendTransactionConfig, /// # }; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; @@ -916,9 +918,9 @@ impl RpcClient { /// &tx, /// config, /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn send_transaction_with_config( &self, @@ -1015,7 +1017,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::{ /// # signature::Signer, @@ -1039,9 +1041,9 @@ impl RpcClient { /// break; /// } /// } - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn confirm_transaction(&self, signature: &Signature) -> ClientResult { Ok(self @@ -1074,7 +1076,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::{ /// # commitment_config::CommitmentConfig, @@ -1101,9 +1103,9 @@ impl RpcClient { /// break; /// } /// } - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn confirm_transaction_with_commitment( &self, @@ -1257,7 +1259,7 @@ impl RpcClient { /// /// ``` /// # use solana_rpc_client_api::{ - /// # client_error::ClientError, + /// # client_error::Error, /// # response::RpcSimulateTransactionResult, /// # }; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; @@ -1278,9 +1280,9 @@ impl RpcClient { /// let tx = system_transaction::transfer(&alice, &bob.pubkey(), lamports, latest_blockhash); /// let result = rpc_client.simulate_transaction(&tx).await?; /// assert!(result.value.err.is_none()); - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn simulate_transaction( &self, @@ -1337,7 +1339,7 @@ impl RpcClient { /// /// ``` /// # use solana_rpc_client_api::{ - /// # client_error::ClientError, + /// # client_error::Error, /// # config::RpcSimulateTransactionConfig, /// # response::RpcSimulateTransactionResult, /// # }; @@ -1365,9 +1367,9 @@ impl RpcClient { /// config, /// ).await?; /// assert!(result.value.err.is_none()); - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn simulate_transaction_with_config( &self, @@ -1408,14 +1410,14 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let snapshot_slot_info = rpc_client.get_highest_snapshot_slot().await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_highest_snapshot_slot(&self) -> ClientResult { if self.get_node_version().await? < semver::Version::new(1, 9, 0) { @@ -1474,7 +1476,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::{ /// # signature::Signer, @@ -1492,9 +1494,9 @@ impl RpcClient { /// # let tx = system_transaction::transfer(&alice, &bob.pubkey(), lamports, latest_blockhash); /// let signature = rpc_client.send_transaction(&tx).await?; /// let status = rpc_client.get_signature_status(&signature).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_signature_status( &self, @@ -1543,7 +1545,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::{ /// # signature::Signer, @@ -1572,9 +1574,9 @@ impl RpcClient { /// }; /// /// assert!(status.err.is_none()); - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_signature_statuses( &self, @@ -1623,7 +1625,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::{ /// # signature::Signer, @@ -1643,9 +1645,9 @@ impl RpcClient { /// if statuses[0].is_none() { /// println!("old transaction does not exist"); /// } - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_signature_statuses_with_history( &self, @@ -1694,7 +1696,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::{ /// # commitment_config::CommitmentConfig, @@ -1716,9 +1718,9 @@ impl RpcClient { /// &signature, /// commitment_config, /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_signature_status_with_commitment( &self, @@ -1766,7 +1768,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::{ /// # commitment_config::CommitmentConfig, @@ -1790,9 +1792,9 @@ impl RpcClient { /// commitment_config, /// search_transaction_history, /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_signature_status_with_commitment_and_history( &self, @@ -1827,14 +1829,14 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let slot = rpc_client.get_slot().await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_slot(&self) -> ClientResult { self.get_slot_with_commitment(self.commitment()).await @@ -1853,16 +1855,16 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::commitment_config::CommitmentConfig; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let commitment_config = CommitmentConfig::processed(); /// let slot = rpc_client.get_slot_with_commitment(commitment_config).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_slot_with_commitment( &self, @@ -1888,14 +1890,14 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let block_height = rpc_client.get_block_height().await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_block_height(&self) -> ClientResult { self.get_block_height_with_commitment(self.commitment()) @@ -1915,7 +1917,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::commitment_config::CommitmentConfig; /// # futures::executor::block_on(async { @@ -1924,9 +1926,9 @@ impl RpcClient { /// let block_height = rpc_client.get_block_height_with_commitment( /// commitment_config, /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_block_height_with_commitment( &self, @@ -1950,7 +1952,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::slot_history::Slot; /// # futures::executor::block_on(async { @@ -1958,9 +1960,9 @@ impl RpcClient { /// let start_slot = 1; /// let limit = 3; /// let leaders = rpc_client.get_slot_leaders(start_slot, limit).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_slot_leaders( &self, @@ -1996,14 +1998,14 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let production = rpc_client.get_block_production().await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_block_production(&self) -> RpcResult { self.send(RpcRequest::GetBlockProduction, Value::Null).await @@ -2021,7 +2023,7 @@ impl RpcClient { /// /// ``` /// # use solana_rpc_client_api::{ - /// # client_error::ClientError, + /// # client_error::Error, /// # config::RpcBlockProductionConfig, /// # config::RpcBlockProductionConfigRange, /// # }; @@ -2049,9 +2051,9 @@ impl RpcClient { /// let production = rpc_client.get_block_production_with_config( /// config /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_block_production_with_config( &self, @@ -2077,7 +2079,7 @@ impl RpcClient { /// /// ``` /// # use solana_rpc_client_api::{ - /// # client_error::ClientError, + /// # client_error::Error, /// # response::StakeActivationState, /// # }; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; @@ -2131,9 +2133,9 @@ impl RpcClient { /// ).await?; /// /// assert_eq!(activation.state, StakeActivationState::Activating); - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_stake_activation( &self, @@ -2169,14 +2171,14 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let supply = rpc_client.supply().await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn supply(&self) -> RpcResult { self.supply_with_commitment(self.commitment()).await @@ -2193,7 +2195,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::commitment_config::CommitmentConfig; /// # futures::executor::block_on(async { @@ -2202,9 +2204,9 @@ impl RpcClient { /// let supply = rpc_client.supply_with_commitment( /// commitment_config, /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn supply_with_commitment( &self, @@ -2230,7 +2232,7 @@ impl RpcClient { /// /// ``` /// # use solana_rpc_client_api::{ - /// # client_error::ClientError, + /// # client_error::Error, /// # config::RpcLargestAccountsConfig, /// # config::RpcLargestAccountsFilter, /// # }; @@ -2246,9 +2248,9 @@ impl RpcClient { /// let accounts = rpc_client.get_largest_accounts_with_config( /// config, /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_largest_accounts_with_config( &self, @@ -2279,14 +2281,14 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let accounts = rpc_client.get_vote_accounts().await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_vote_accounts(&self) -> ClientResult { self.get_vote_accounts_with_commitment(self.commitment()) @@ -2308,7 +2310,7 @@ impl RpcClient { /// /// ``` /// # use solana_sdk::commitment_config::CommitmentConfig; - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); @@ -2316,9 +2318,9 @@ impl RpcClient { /// let accounts = rpc_client.get_vote_accounts_with_commitment( /// commitment_config, /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_vote_accounts_with_commitment( &self, @@ -2346,7 +2348,7 @@ impl RpcClient { /// /// ``` /// # use solana_rpc_client_api::{ - /// # client_error::ClientError, + /// # client_error::Error, /// # config::RpcGetVoteAccountsConfig, /// # }; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; @@ -2369,9 +2371,9 @@ impl RpcClient { /// let accounts = rpc_client.get_vote_accounts_with_config( /// config, /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_vote_accounts_with_config( &self, @@ -2425,14 +2427,14 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let cluster_nodes = rpc_client.get_cluster_nodes().await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_cluster_nodes(&self) -> ClientResult> { self.send(RpcRequest::GetClusterNodes, Value::Null).await @@ -2457,15 +2459,15 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let slot = rpc_client.get_slot().await?; /// let block = rpc_client.get_block(slot).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_block(&self, slot: Slot) -> ClientResult { self.get_block_with_encoding(slot, UiTransactionEncoding::Json) @@ -2484,7 +2486,7 @@ impl RpcClient { /// /// ``` /// # use solana_transaction_status::UiTransactionEncoding; - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); @@ -2494,9 +2496,9 @@ impl RpcClient { /// slot, /// encoding, /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_block_with_encoding( &self, @@ -2527,7 +2529,7 @@ impl RpcClient { /// # }; /// # use solana_rpc_client_api::{ /// # config::RpcBlockConfig, - /// # client_error::ClientError, + /// # client_error::Error, /// # }; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { @@ -2544,9 +2546,9 @@ impl RpcClient { /// slot, /// config, /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_block_with_config( &self, @@ -2629,7 +2631,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); @@ -2637,9 +2639,9 @@ impl RpcClient { /// let start_slot = 0; /// let end_slot = 9; /// let blocks = rpc_client.get_blocks(start_slot, Some(end_slot)).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_blocks( &self, @@ -2692,7 +2694,7 @@ impl RpcClient { /// /// ``` /// # use solana_sdk::commitment_config::CommitmentConfig; - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); @@ -2706,9 +2708,9 @@ impl RpcClient { /// Some(end_slot), /// commitment_config, /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_blocks_with_commitment( &self, @@ -2755,7 +2757,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); @@ -2763,9 +2765,9 @@ impl RpcClient { /// let start_slot = 0; /// let limit = 10; /// let blocks = rpc_client.get_blocks_with_limit(start_slot, limit).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_blocks_with_limit( &self, @@ -2805,7 +2807,7 @@ impl RpcClient { /// /// ``` /// # use solana_sdk::commitment_config::CommitmentConfig; - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); @@ -2818,9 +2820,9 @@ impl RpcClient { /// limit, /// commitment_config, /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_blocks_with_limit_and_commitment( &self, @@ -2940,7 +2942,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::{ /// # signature::Signer, @@ -2953,9 +2955,9 @@ impl RpcClient { /// let signatures = rpc_client.get_signatures_for_address( /// &alice.pubkey(), /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_signatures_for_address( &self, @@ -2990,7 +2992,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::{ /// # nonblocking::rpc_client::RpcClient, /// # rpc_client::GetConfirmedSignaturesForAddress2Config, @@ -3019,9 +3021,9 @@ impl RpcClient { /// &alice.pubkey(), /// config, /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_signatures_for_address_with_config( &self, @@ -3109,7 +3111,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::{ /// # signature::Signer, @@ -3130,9 +3132,9 @@ impl RpcClient { /// &signature, /// UiTransactionEncoding::Json, /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_transaction( &self, @@ -3169,7 +3171,7 @@ impl RpcClient { /// /// ``` /// # use solana_rpc_client_api::{ - /// # client_error::ClientError, + /// # client_error::Error, /// # config::RpcTransactionConfig, /// # }; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; @@ -3198,9 +3200,9 @@ impl RpcClient { /// &signature, /// config, /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_transaction_with_config( &self, @@ -3259,16 +3261,16 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// // Get the time of the most recent finalized block /// let slot = rpc_client.get_slot().await?; /// let block_time = rpc_client.get_block_time(slot).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_block_time(&self, slot: Slot) -> ClientResult { let request = RpcRequest::GetBlockTime; @@ -3302,14 +3304,14 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let epoch_info = rpc_client.get_epoch_info().await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_epoch_info(&self) -> ClientResult { self.get_epoch_info_with_commitment(self.commitment()).await @@ -3326,7 +3328,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::commitment_config::CommitmentConfig; /// # futures::executor::block_on(async { @@ -3335,9 +3337,9 @@ impl RpcClient { /// let epoch_info = rpc_client.get_epoch_info_with_commitment( /// commitment_config, /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_epoch_info_with_commitment( &self, @@ -3365,7 +3367,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::commitment_config::CommitmentConfig; /// # futures::executor::block_on(async { @@ -3374,9 +3376,9 @@ impl RpcClient { /// let leader_schedule = rpc_client.get_leader_schedule( /// Some(slot), /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_leader_schedule( &self, @@ -3397,7 +3399,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::commitment_config::CommitmentConfig; /// # futures::executor::block_on(async { @@ -3408,9 +3410,9 @@ impl RpcClient { /// Some(slot), /// commitment_config, /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_leader_schedule_with_commitment( &self, @@ -3439,7 +3441,7 @@ impl RpcClient { /// /// ``` /// # use solana_rpc_client_api::{ - /// # client_error::ClientError, + /// # client_error::Error, /// # config::RpcLeaderScheduleConfig, /// # }; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; @@ -3456,9 +3458,9 @@ impl RpcClient { /// Some(slot), /// config, /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_leader_schedule_with_config( &self, @@ -3480,14 +3482,14 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let epoch_schedule = rpc_client.get_epoch_schedule().await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_epoch_schedule(&self) -> ClientResult { self.send(RpcRequest::GetEpochSchedule, Value::Null).await @@ -3507,7 +3509,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); @@ -3515,9 +3517,9 @@ impl RpcClient { /// let performance_samples = rpc_client.get_recent_performance_samples( /// Some(limit), /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_recent_performance_samples( &self, @@ -3538,14 +3540,14 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let identity = rpc_client.get_identity().await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_identity(&self) -> ClientResult { let rpc_identity: RpcIdentity = self.send(RpcRequest::GetIdentity, Value::Null).await?; @@ -3575,14 +3577,14 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let inflation_governor = rpc_client.get_inflation_governor().await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_inflation_governor(&self) -> ClientResult { self.send(RpcRequest::GetInflationGovernor, Value::Null) @@ -3600,14 +3602,14 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let inflation_rate = rpc_client.get_inflation_rate().await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_inflation_rate(&self) -> ClientResult { self.send(RpcRequest::GetInflationRate, Value::Null).await @@ -3628,7 +3630,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::signature::{Keypair, Signer}; /// # futures::executor::block_on(async { @@ -3642,9 +3644,9 @@ impl RpcClient { /// &addresses, /// Some(epoch), /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_inflation_reward( &self, @@ -3680,7 +3682,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::signature::{Keypair, Signer}; /// # futures::executor::block_on(async { @@ -3712,14 +3714,14 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let slot = rpc_client.minimum_ledger_slot().await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn minimum_ledger_slot(&self) -> ClientResult { self.send(RpcRequest::MinimumLedgerSlot, Value::Null).await @@ -3752,7 +3754,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::{self, RpcClient}; /// # use solana_sdk::{ /// # signature::Signer, @@ -3765,9 +3767,9 @@ impl RpcClient { /// # let rpc_client = RpcClient::new_mock_with_mocks("succeeds".to_string(), mocks); /// let alice_pubkey = Pubkey::from_str("BgvYtJEfmZYdVKiptmMjxGzv8iQoo4MWjsP3QsTkhhxa").unwrap(); /// let account = rpc_client.get_account(&alice_pubkey).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_account(&self, pubkey: &Pubkey) -> ClientResult { self.get_account_with_commitment(pubkey, self.commitment()) @@ -3793,7 +3795,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::{self, RpcClient}; /// # use solana_sdk::{ /// # signature::Signer, @@ -3812,9 +3814,9 @@ impl RpcClient { /// commitment_config, /// ).await?; /// assert!(account.value.is_some()); - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_account_with_commitment( &self, @@ -3850,7 +3852,7 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::{ /// # config::RpcAccountInfoConfig, - /// # client_error::ClientError, + /// # client_error::Error, /// # }; /// # use solana_rpc_client::nonblocking::rpc_client::{self, RpcClient}; /// # use solana_sdk::{ @@ -3876,9 +3878,9 @@ impl RpcClient { /// config, /// ).await?; /// assert!(account.value.is_some()); - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_account_with_config( &self, @@ -3931,14 +3933,14 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let slot = rpc_client.get_max_retransmit_slot().await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) pub async fn get_max_retransmit_slot(&self) -> ClientResult { self.send(RpcRequest::GetMaxRetransmitSlot, Value::Null) .await @@ -3956,14 +3958,14 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let slot = rpc_client.get_max_shred_insert_slot().await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) pub async fn get_max_shred_insert_slot(&self) -> ClientResult { self.send(RpcRequest::GetMaxShredInsertSlot, Value::Null) .await @@ -3984,7 +3986,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::{ /// # signature::Signer, @@ -3996,9 +3998,9 @@ impl RpcClient { /// # let bob = Keypair::new(); /// let pubkeys = vec![alice.pubkey(), bob.pubkey()]; /// let accounts = rpc_client.get_multiple_accounts(&pubkeys).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_multiple_accounts( &self, @@ -4021,7 +4023,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::{ /// # signature::Signer, @@ -4038,9 +4040,9 @@ impl RpcClient { /// &pubkeys, /// commitment_config, /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_multiple_accounts_with_commitment( &self, @@ -4072,7 +4074,7 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::{ /// # config::RpcAccountInfoConfig, - /// # client_error::ClientError, + /// # client_error::Error, /// # }; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::{ @@ -4096,9 +4098,9 @@ impl RpcClient { /// &pubkeys, /// config, /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_multiple_accounts_with_config( &self, @@ -4144,7 +4146,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::{self, RpcClient}; /// # use solana_sdk::{ /// # signature::Signer, @@ -4157,9 +4159,9 @@ impl RpcClient { /// # let rpc_client = RpcClient::new_mock_with_mocks("succeeds".to_string(), mocks); /// let alice_pubkey = Pubkey::from_str("BgvYtJEfmZYdVKiptmMjxGzv8iQoo4MWjsP3QsTkhhxa").unwrap(); /// let account_data = rpc_client.get_account_data(&alice_pubkey).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_account_data(&self, pubkey: &Pubkey) -> ClientResult> { Ok(self.get_account(pubkey).await?.data) @@ -4177,15 +4179,15 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let data_len = 300; /// let balance = rpc_client.get_minimum_balance_for_rent_exemption(data_len).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_minimum_balance_for_rent_exemption( &self, @@ -4222,7 +4224,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::{ /// # signature::Signer, @@ -4232,9 +4234,9 @@ impl RpcClient { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); /// let balance = rpc_client.get_balance(&alice.pubkey()).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_balance(&self, pubkey: &Pubkey) -> ClientResult { Ok(self @@ -4254,7 +4256,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::{ /// # signature::Signer, @@ -4269,9 +4271,9 @@ impl RpcClient { /// &alice.pubkey(), /// commitment_config, /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_balance_with_commitment( &self, @@ -4304,7 +4306,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::{ /// # signature::Signer, @@ -4314,9 +4316,9 @@ impl RpcClient { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); /// let accounts = rpc_client.get_program_accounts(&alice.pubkey()).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_program_accounts( &self, @@ -4347,7 +4349,7 @@ impl RpcClient { /// /// ``` /// # use solana_rpc_client_api::{ - /// # client_error::ClientError, + /// # client_error::Error, /// # config::{RpcAccountInfoConfig, RpcProgramAccountsConfig}, /// # filter::{MemcmpEncodedBytes, RpcFilterType, Memcmp}, /// # }; @@ -4390,9 +4392,9 @@ impl RpcClient { /// &alice.pubkey(), /// config, /// ).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_program_accounts_with_config( &self, @@ -4428,14 +4430,14 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let stake_minimum_delegation = rpc_client.get_stake_minimum_delegation().await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_stake_minimum_delegation(&self) -> ClientResult { self.get_stake_minimum_delegation_with_commitment(self.commitment()) @@ -4453,15 +4455,15 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::nonblocking::rpc_client::RpcClient; /// # use solana_sdk::commitment_config::CommitmentConfig; /// # futures::executor::block_on(async { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let stake_minimum_delegation = rpc_client.get_stake_minimum_delegation_with_commitment(CommitmentConfig::confirmed()).await?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// # })?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub async fn get_stake_minimum_delegation_with_commitment( &self, diff --git a/rpc-client/src/rpc_client.rs b/rpc-client/src/rpc_client.rs index 8fbb522ebaa3ee..d90f2d4cc811c7 100644 --- a/rpc-client/src/rpc_client.rs +++ b/rpc-client/src/rpc_client.rs @@ -129,7 +129,7 @@ pub struct GetConfirmedSignaturesForAddress2Config { /// /// ``` /// # use solana_sdk::system_transaction; -/// # use solana_rpc_client_api::client_error::ClientError; +/// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::signature::{Keypair, Signer}; /// # use solana_sdk::hash::Hash; @@ -141,7 +141,7 @@ pub struct GetConfirmedSignaturesForAddress2Config { /// # let tx = system_transaction::transfer(&key, &to, lamports, latest_blockhash); /// let signature = rpc_client.send_transaction(&tx)?; /// let statuses = rpc_client.get_signature_statuses(&[signature])?.value; -/// # Ok::<(), ClientError>(()) +/// # Ok::<(), Error>(()) /// ``` /// /// Requests may timeout, in which case they return a [`ClientError`] where the @@ -151,9 +151,9 @@ pub struct GetConfirmedSignaturesForAddress2Config { /// returns `true`. The default timeout is 30 seconds, and may be changed by /// calling an appropriate constructor with a `timeout` parameter. /// -/// [`ClientError`]: solana_rpc_client_api::client_error::ClientError -/// [`ClientErrorKind`]: solana_rpc_client_api::client_error::ClientErrorKind -/// [`ClientErrorKind::Reqwest`]: solana_rpc_client_api::client_error::ClientErrorKind::Reqwest +/// [`ClientError`]: solana_rpc_client_api::client_error::Error +/// [`ClientErrorKind`]: solana_rpc_client_api::client_error::ErrorKind +/// [`ClientErrorKind::Reqwest`]: solana_rpc_client_api::client_error::ErrorKind::Reqwest pub struct RpcClient { rpc_client: Arc, runtime: Option, @@ -607,7 +607,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::{ /// # signature::Signer, @@ -622,7 +622,7 @@ impl RpcClient { /// # let latest_blockhash = rpc_client.get_latest_blockhash()?; /// let tx = system_transaction::transfer(&alice, &bob.pubkey(), lamports, latest_blockhash); /// let signature = rpc_client.send_and_confirm_transaction(&tx)?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn send_and_confirm_transaction( &self, @@ -715,7 +715,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::{ /// # signature::Signer, @@ -732,7 +732,7 @@ impl RpcClient { /// let latest_blockhash = rpc_client.get_latest_blockhash()?; /// let tx = system_transaction::transfer(&alice, &bob.pubkey(), lamports, latest_blockhash); /// let signature = rpc_client.send_transaction(&tx)?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn send_transaction(&self, transaction: &Transaction) -> ClientResult { self.invoke((self.rpc_client.as_ref()).send_transaction(transaction)) @@ -789,7 +789,7 @@ impl RpcClient { /// /// ``` /// # use solana_rpc_client_api::{ - /// # client_error::ClientError, + /// # client_error::Error, /// # config::RpcSendTransactionConfig, /// # }; /// # use solana_rpc_client::rpc_client::RpcClient; @@ -815,7 +815,7 @@ impl RpcClient { /// &tx, /// config, /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn send_transaction_with_config( &self, @@ -857,7 +857,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::{ /// # signature::Signer, @@ -880,7 +880,7 @@ impl RpcClient { /// break; /// } /// } - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn confirm_transaction(&self, signature: &Signature) -> ClientResult { self.invoke((self.rpc_client.as_ref()).confirm_transaction(signature)) @@ -910,7 +910,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::{ /// # commitment_config::CommitmentConfig, @@ -936,7 +936,7 @@ impl RpcClient { /// break; /// } /// } - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn confirm_transaction_with_commitment( &self, @@ -994,7 +994,7 @@ impl RpcClient { /// /// ``` /// # use solana_rpc_client_api::{ - /// # client_error::ClientError, + /// # client_error::Error, /// # response::RpcSimulateTransactionResult, /// # }; /// # use solana_rpc_client::rpc_client::RpcClient; @@ -1014,7 +1014,7 @@ impl RpcClient { /// let tx = system_transaction::transfer(&alice, &bob.pubkey(), lamports, latest_blockhash); /// let result = rpc_client.simulate_transaction(&tx)?; /// assert!(result.value.err.is_none()); - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn simulate_transaction( &self, @@ -1064,7 +1064,7 @@ impl RpcClient { /// /// ``` /// # use solana_rpc_client_api::{ - /// # client_error::ClientError, + /// # client_error::Error, /// # config::RpcSimulateTransactionConfig, /// # response::RpcSimulateTransactionResult, /// # }; @@ -1091,7 +1091,7 @@ impl RpcClient { /// config, /// )?; /// assert!(result.value.err.is_none()); - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn simulate_transaction_with_config( &self, @@ -1117,11 +1117,11 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let snapshot_slot_info = rpc_client.get_highest_snapshot_slot()?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_highest_snapshot_slot(&self) -> ClientResult { self.invoke((self.rpc_client.as_ref()).get_highest_snapshot_slot()) @@ -1169,7 +1169,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::{ /// # signature::Signer, @@ -1186,7 +1186,7 @@ impl RpcClient { /// # let tx = system_transaction::transfer(&alice, &bob.pubkey(), lamports, latest_blockhash); /// let signature = rpc_client.send_transaction(&tx)?; /// let status = rpc_client.get_signature_status(&signature)?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_signature_status( &self, @@ -1234,7 +1234,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::{ /// # signature::Signer, @@ -1262,7 +1262,7 @@ impl RpcClient { /// }; /// /// assert!(status.err.is_none()); - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_signature_statuses( &self, @@ -1309,7 +1309,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::{ /// # signature::Signer, @@ -1328,7 +1328,7 @@ impl RpcClient { /// if statuses[0].is_none() { /// println!("old transaction does not exist"); /// } - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_signature_statuses_with_history( &self, @@ -1370,7 +1370,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::{ /// # commitment_config::CommitmentConfig, @@ -1391,7 +1391,7 @@ impl RpcClient { /// &signature, /// commitment_config, /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_signature_status_with_commitment( &self, @@ -1433,7 +1433,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::{ /// # commitment_config::CommitmentConfig, @@ -1456,7 +1456,7 @@ impl RpcClient { /// commitment_config, /// search_transaction_history, /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_signature_status_with_commitment_and_history( &self, @@ -1486,11 +1486,11 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let slot = rpc_client.get_slot()?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_slot(&self) -> ClientResult { self.invoke((self.rpc_client.as_ref()).get_slot()) @@ -1509,13 +1509,13 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::commitment_config::CommitmentConfig; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let commitment_config = CommitmentConfig::processed(); /// let slot = rpc_client.get_slot_with_commitment(commitment_config)?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_slot_with_commitment( &self, @@ -1537,11 +1537,11 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let block_height = rpc_client.get_block_height()?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_block_height(&self) -> ClientResult { self.invoke((self.rpc_client.as_ref()).get_block_height()) @@ -1560,7 +1560,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::commitment_config::CommitmentConfig; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); @@ -1568,7 +1568,7 @@ impl RpcClient { /// let block_height = rpc_client.get_block_height_with_commitment( /// commitment_config, /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_block_height_with_commitment( &self, @@ -1588,14 +1588,14 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::slot_history::Slot; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let start_slot = 1; /// let limit = 3; /// let leaders = rpc_client.get_slot_leaders(start_slot, limit)?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_slot_leaders(&self, start_slot: Slot, limit: u64) -> ClientResult> { self.invoke((self.rpc_client.as_ref()).get_slot_leaders(start_slot, limit)) @@ -1612,11 +1612,11 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let production = rpc_client.get_block_production()?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_block_production(&self) -> RpcResult { self.invoke((self.rpc_client.as_ref()).get_block_production()) @@ -1634,7 +1634,7 @@ impl RpcClient { /// /// ``` /// # use solana_rpc_client_api::{ - /// # client_error::ClientError, + /// # client_error::Error, /// # config::{RpcBlockProductionConfig, RpcBlockProductionConfigRange}, /// # }; /// # use solana_rpc_client::rpc_client::RpcClient; @@ -1660,7 +1660,7 @@ impl RpcClient { /// let production = rpc_client.get_block_production_with_config( /// config /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_block_production_with_config( &self, @@ -1685,7 +1685,7 @@ impl RpcClient { /// /// ``` /// # use solana_rpc_client_api::{ - /// # client_error::ClientError, + /// # client_error::Error, /// # response::StakeActivationState, /// # }; /// # use solana_rpc_client::rpc_client::RpcClient; @@ -1738,7 +1738,7 @@ impl RpcClient { /// )?; /// /// assert_eq!(activation.state, StakeActivationState::Activating); - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_stake_activation( &self, @@ -1763,11 +1763,11 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let supply = rpc_client.supply()?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn supply(&self) -> RpcResult { self.invoke((self.rpc_client.as_ref()).supply()) @@ -1784,7 +1784,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::commitment_config::CommitmentConfig; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); @@ -1792,7 +1792,7 @@ impl RpcClient { /// let supply = rpc_client.supply_with_commitment( /// commitment_config, /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn supply_with_commitment( &self, @@ -1814,7 +1814,7 @@ impl RpcClient { /// /// ``` /// # use solana_rpc_client_api::{ - /// # client_error::ClientError, + /// # client_error::Error, /// # config::{RpcLargestAccountsConfig, RpcLargestAccountsFilter}, /// # }; /// # use solana_rpc_client::rpc_client::RpcClient; @@ -1828,7 +1828,7 @@ impl RpcClient { /// let accounts = rpc_client.get_largest_accounts_with_config( /// config, /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_largest_accounts_with_config( &self, @@ -1852,11 +1852,11 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let accounts = rpc_client.get_vote_accounts()?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_vote_accounts(&self) -> ClientResult { self.invoke((self.rpc_client.as_ref()).get_vote_accounts()) @@ -1876,7 +1876,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::commitment_config::CommitmentConfig; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); @@ -1884,7 +1884,7 @@ impl RpcClient { /// let accounts = rpc_client.get_vote_accounts_with_commitment( /// commitment_config, /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_vote_accounts_with_commitment( &self, @@ -1908,7 +1908,7 @@ impl RpcClient { /// /// ``` /// # use solana_rpc_client_api::{ - /// # client_error::ClientError, + /// # client_error::Error, /// # config::RpcGetVoteAccountsConfig, /// # }; /// # use solana_rpc_client::rpc_client::RpcClient; @@ -1930,7 +1930,7 @@ impl RpcClient { /// let accounts = rpc_client.get_vote_accounts_with_config( /// config, /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_vote_accounts_with_config( &self, @@ -1959,11 +1959,11 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let cluster_nodes = rpc_client.get_cluster_nodes()?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_cluster_nodes(&self) -> ClientResult> { self.invoke((self.rpc_client.as_ref()).get_cluster_nodes()) @@ -1988,12 +1988,12 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let slot = rpc_client.get_slot()?; /// let block = rpc_client.get_block(slot)?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_block(&self, slot: Slot) -> ClientResult { self.invoke((self.rpc_client.as_ref()).get_block(slot)) @@ -2010,7 +2010,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_transaction_status::UiTransactionEncoding; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); @@ -2020,7 +2020,7 @@ impl RpcClient { /// slot, /// encoding, /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_block_with_encoding( &self, @@ -2043,7 +2043,7 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::{ /// # config::RpcBlockConfig, - /// # client_error::ClientError, + /// # client_error::Error, /// # }; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_transaction_status::{ @@ -2063,7 +2063,7 @@ impl RpcClient { /// slot, /// config, /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_block_with_config( &self, @@ -2139,14 +2139,14 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// // Get up to the first 10 blocks /// let start_slot = 0; /// let end_slot = 9; /// let blocks = rpc_client.get_blocks(start_slot, Some(end_slot))?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_blocks(&self, start_slot: Slot, end_slot: Option) -> ClientResult> { self.invoke((self.rpc_client.as_ref()).get_blocks(start_slot, end_slot)) @@ -2190,7 +2190,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::commitment_config::CommitmentConfig; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); @@ -2204,7 +2204,7 @@ impl RpcClient { /// Some(end_slot), /// commitment_config, /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_blocks_with_commitment( &self, @@ -2242,14 +2242,14 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// // Get the first 10 blocks /// let start_slot = 0; /// let limit = 10; /// let blocks = rpc_client.get_blocks_with_limit(start_slot, limit)?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_blocks_with_limit(&self, start_slot: Slot, limit: usize) -> ClientResult> { self.invoke((self.rpc_client.as_ref()).get_blocks_with_limit(start_slot, limit)) @@ -2279,7 +2279,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::commitment_config::CommitmentConfig; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); @@ -2292,7 +2292,7 @@ impl RpcClient { /// limit, /// commitment_config, /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_blocks_with_limit_and_commitment( &self, @@ -2393,7 +2393,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::{ /// # signature::Signer, @@ -2405,7 +2405,7 @@ impl RpcClient { /// let signatures = rpc_client.get_signatures_for_address( /// &alice.pubkey(), /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_signatures_for_address( &self, @@ -2436,7 +2436,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::{GetConfirmedSignaturesForAddress2Config, RpcClient}; /// # use solana_sdk::{ /// # signature::Signer, @@ -2461,7 +2461,7 @@ impl RpcClient { /// &alice.pubkey(), /// config, /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_signatures_for_address_with_config( &self, @@ -2520,7 +2520,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::{ /// # signature::Signer, @@ -2540,7 +2540,7 @@ impl RpcClient { /// &signature, /// UiTransactionEncoding::Json, /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_transaction( &self, @@ -2573,7 +2573,7 @@ impl RpcClient { /// /// ``` /// # use solana_rpc_client_api::{ - /// # client_error::ClientError, + /// # client_error::Error, /// # config::RpcTransactionConfig, /// # }; /// # use solana_rpc_client::rpc_client::RpcClient; @@ -2601,7 +2601,7 @@ impl RpcClient { /// &signature, /// config, /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_transaction_with_config( &self, @@ -2650,13 +2650,13 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// // Get the time of the most recent finalized block /// let slot = rpc_client.get_slot()?; /// let block_time = rpc_client.get_block_time(slot)?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_block_time(&self, slot: Slot) -> ClientResult { self.invoke((self.rpc_client.as_ref()).get_block_time(slot)) @@ -2677,11 +2677,11 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let epoch_info = rpc_client.get_epoch_info()?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_epoch_info(&self) -> ClientResult { self.invoke((self.rpc_client.as_ref()).get_epoch_info()) @@ -2698,7 +2698,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::commitment_config::CommitmentConfig; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); @@ -2706,7 +2706,7 @@ impl RpcClient { /// let epoch_info = rpc_client.get_epoch_info_with_commitment( /// commitment_config, /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_epoch_info_with_commitment( &self, @@ -2730,7 +2730,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::commitment_config::CommitmentConfig; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); @@ -2738,7 +2738,7 @@ impl RpcClient { /// let leader_schedule = rpc_client.get_leader_schedule( /// Some(slot), /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_leader_schedule( &self, @@ -2758,7 +2758,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::commitment_config::CommitmentConfig; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); @@ -2768,7 +2768,7 @@ impl RpcClient { /// Some(slot), /// commitment_config, /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_leader_schedule_with_commitment( &self, @@ -2792,7 +2792,7 @@ impl RpcClient { /// /// ``` /// # use solana_rpc_client_api::{ - /// # client_error::ClientError, + /// # client_error::Error, /// # config::RpcLeaderScheduleConfig, /// # }; /// # use solana_rpc_client::rpc_client::RpcClient; @@ -2808,7 +2808,7 @@ impl RpcClient { /// Some(slot), /// config, /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_leader_schedule_with_config( &self, @@ -2829,11 +2829,11 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let epoch_schedule = rpc_client.get_epoch_schedule()?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_epoch_schedule(&self) -> ClientResult { self.invoke((self.rpc_client.as_ref()).get_epoch_schedule()) @@ -2853,14 +2853,14 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let limit = 10; /// let performance_samples = rpc_client.get_recent_performance_samples( /// Some(limit), /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_recent_performance_samples( &self, @@ -2880,11 +2880,11 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let identity = rpc_client.get_identity()?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_identity(&self) -> ClientResult { self.invoke((self.rpc_client.as_ref()).get_identity()) @@ -2907,11 +2907,11 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let inflation_governor = rpc_client.get_inflation_governor()?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_inflation_governor(&self) -> ClientResult { self.invoke((self.rpc_client.as_ref()).get_inflation_governor()) @@ -2928,11 +2928,11 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let inflation_rate = rpc_client.get_inflation_rate()?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_inflation_rate(&self) -> ClientResult { self.invoke((self.rpc_client.as_ref()).get_inflation_rate()) @@ -2953,7 +2953,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::signature::{Keypair, Signer}; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); @@ -2966,7 +2966,7 @@ impl RpcClient { /// &addresses, /// Some(epoch), /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_inflation_reward( &self, @@ -2987,7 +2987,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::signature::{Keypair, Signer}; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); @@ -3016,11 +3016,11 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let slot = rpc_client.minimum_ledger_slot()?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn minimum_ledger_slot(&self) -> ClientResult { self.invoke((self.rpc_client.as_ref()).minimum_ledger_slot()) @@ -3054,7 +3054,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::{self, RpcClient}; /// # use solana_sdk::{ /// # signature::Signer, @@ -3066,7 +3066,7 @@ impl RpcClient { /// # let rpc_client = RpcClient::new_mock_with_mocks("succeeds".to_string(), mocks); /// let alice_pubkey = Pubkey::from_str("BgvYtJEfmZYdVKiptmMjxGzv8iQoo4MWjsP3QsTkhhxa").unwrap(); /// let account = rpc_client.get_account(&alice_pubkey)?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_account(&self, pubkey: &Pubkey) -> ClientResult { self.invoke((self.rpc_client.as_ref()).get_account(pubkey)) @@ -3089,7 +3089,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::{self, RpcClient}; /// # use solana_sdk::{ /// # signature::Signer, @@ -3107,7 +3107,7 @@ impl RpcClient { /// commitment_config, /// )?; /// assert!(account.value.is_some()); - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_account_with_commitment( &self, @@ -3138,7 +3138,7 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::{ /// # config::RpcAccountInfoConfig, - /// # client_error::ClientError, + /// # client_error::Error, /// # }; /// # use solana_rpc_client::rpc_client::{self, RpcClient}; /// # use solana_sdk::{ @@ -3163,7 +3163,7 @@ impl RpcClient { /// config, /// )?; /// assert!(account.value.is_some()); - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_account_with_config( &self, @@ -3185,11 +3185,11 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let slot = rpc_client.get_max_retransmit_slot()?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) pub fn get_max_retransmit_slot(&self) -> ClientResult { self.invoke((self.rpc_client.as_ref()).get_max_retransmit_slot()) } @@ -3206,11 +3206,11 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let slot = rpc_client.get_max_shred_insert_slot()?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) pub fn get_max_shred_insert_slot(&self) -> ClientResult { self.invoke((self.rpc_client.as_ref()).get_max_shred_insert_slot()) } @@ -3230,7 +3230,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::{ /// # signature::Signer, @@ -3241,7 +3241,7 @@ impl RpcClient { /// # let bob = Keypair::new(); /// let pubkeys = vec![alice.pubkey(), bob.pubkey()]; /// let accounts = rpc_client.get_multiple_accounts(&pubkeys)?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_multiple_accounts(&self, pubkeys: &[Pubkey]) -> ClientResult>> { self.invoke((self.rpc_client.as_ref()).get_multiple_accounts(pubkeys)) @@ -3258,7 +3258,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::{ /// # signature::Signer, @@ -3274,7 +3274,7 @@ impl RpcClient { /// &pubkeys, /// commitment_config, /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_multiple_accounts_with_commitment( &self, @@ -3300,7 +3300,7 @@ impl RpcClient { /// ``` /// # use solana_rpc_client_api::{ /// # config::RpcAccountInfoConfig, - /// # client_error::ClientError, + /// # client_error::Error, /// # }; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::{ @@ -3323,7 +3323,7 @@ impl RpcClient { /// &pubkeys, /// config, /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_multiple_accounts_with_config( &self, @@ -3350,7 +3350,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::{self, RpcClient}; /// # use solana_sdk::{ /// # signature::Signer, @@ -3362,7 +3362,7 @@ impl RpcClient { /// # let rpc_client = RpcClient::new_mock_with_mocks("succeeds".to_string(), mocks); /// let alice_pubkey = Pubkey::from_str("BgvYtJEfmZYdVKiptmMjxGzv8iQoo4MWjsP3QsTkhhxa").unwrap(); /// let account_data = rpc_client.get_account_data(&alice_pubkey)?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_account_data(&self, pubkey: &Pubkey) -> ClientResult> { self.invoke((self.rpc_client.as_ref()).get_account_data(pubkey)) @@ -3380,12 +3380,12 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let data_len = 300; /// let balance = rpc_client.get_minimum_balance_for_rent_exemption(data_len)?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_minimum_balance_for_rent_exemption(&self, data_len: usize) -> ClientResult { self.invoke((self.rpc_client.as_ref()).get_minimum_balance_for_rent_exemption(data_len)) @@ -3406,7 +3406,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::{ /// # signature::Signer, @@ -3415,7 +3415,7 @@ impl RpcClient { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); /// let balance = rpc_client.get_balance(&alice.pubkey())?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_balance(&self, pubkey: &Pubkey) -> ClientResult { self.invoke((self.rpc_client.as_ref()).get_balance(pubkey)) @@ -3432,7 +3432,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::{ /// # signature::Signer, @@ -3446,7 +3446,7 @@ impl RpcClient { /// &alice.pubkey(), /// commitment_config, /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_balance_with_commitment( &self, @@ -3474,7 +3474,7 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::{ /// # signature::Signer, @@ -3483,7 +3483,7 @@ impl RpcClient { /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// # let alice = Keypair::new(); /// let accounts = rpc_client.get_program_accounts(&alice.pubkey())?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_program_accounts(&self, pubkey: &Pubkey) -> ClientResult> { self.invoke((self.rpc_client.as_ref()).get_program_accounts(pubkey)) @@ -3501,7 +3501,7 @@ impl RpcClient { /// /// ``` /// # use solana_rpc_client_api::{ - /// # client_error::ClientError, + /// # client_error::Error, /// # config::{RpcAccountInfoConfig, RpcProgramAccountsConfig}, /// # filter::{MemcmpEncodedBytes, RpcFilterType, Memcmp}, /// # }; @@ -3543,7 +3543,7 @@ impl RpcClient { /// &alice.pubkey(), /// config, /// )?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_program_accounts_with_config( &self, @@ -3564,11 +3564,11 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let stake_minimum_delegation = rpc_client.get_stake_minimum_delegation()?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_stake_minimum_delegation(&self) -> ClientResult { self.invoke((self.rpc_client.as_ref()).get_stake_minimum_delegation()) @@ -3585,13 +3585,13 @@ impl RpcClient { /// # Examples /// /// ``` - /// # use solana_rpc_client_api::client_error::ClientError; + /// # use solana_rpc_client_api::client_error::Error; /// # use solana_rpc_client::rpc_client::RpcClient; /// # use solana_sdk::commitment_config::CommitmentConfig; /// # let rpc_client = RpcClient::new_mock("succeeds".to_string()); /// let stake_minimum_delegation = /// rpc_client.get_stake_minimum_delegation_with_commitment(CommitmentConfig::confirmed())?; - /// # Ok::<(), ClientError>(()) + /// # Ok::<(), Error>(()) /// ``` pub fn get_stake_minimum_delegation_with_commitment( &self, @@ -4002,7 +4002,7 @@ mod tests { jsonrpc_core::{futures::prelude::*, Error, IoHandler, Params}, jsonrpc_http_server::{AccessControlAllowOrigin, DomainsValidation, ServerBuilder}, serde_json::{json, Number}, - solana_rpc_client_api::client_error::ClientErrorKind, + solana_rpc_client_api::client_error::ErrorKind, solana_sdk::{ instruction::InstructionError, signature::{Keypair, Signer}, @@ -4172,7 +4172,7 @@ mod tests { let result = rpc_client.send_and_confirm_transaction(&tx); assert_matches!( result.unwrap_err().kind(), - ClientErrorKind::TransactionError(TransactionError::InstructionError( + ErrorKind::TransactionError(TransactionError::InstructionError( 0, InstructionError::UninitializedAccount )) @@ -4180,7 +4180,7 @@ mod tests { let rpc_client = RpcClient::new_mock("sig_not_found".to_string()); let result = rpc_client.send_and_confirm_transaction(&tx); - if let ClientErrorKind::Io(err) = result.unwrap_err().kind() { + if let ErrorKind::Io(err) = result.unwrap_err().kind() { assert_eq!(err.kind(), io::ErrorKind::Other); } } diff --git a/tpu-client/src/nonblocking/quic_client.rs b/tpu-client/src/nonblocking/quic_client.rs index d6b2a6d8539a00..295460aabc8a61 100644 --- a/tpu-client/src/nonblocking/quic_client.rs +++ b/tpu-client/src/nonblocking/quic_client.rs @@ -17,7 +17,7 @@ use { }, solana_measure::measure::Measure, solana_net_utils::VALIDATOR_PORT_RANGE, - solana_rpc_client_api::client_error::ClientErrorKind, + solana_rpc_client_api::client_error::ErrorKind as ClientErrorKind, solana_sdk::{ quic::{ QUIC_CONNECTION_HANDSHAKE_TIMEOUT_MS, QUIC_KEEP_ALIVE_MS, QUIC_MAX_TIMEOUT_MS, diff --git a/tpu-client/src/nonblocking/tpu_client.rs b/tpu-client/src/nonblocking/tpu_client.rs index b4667706b46a15..a09333d0b11025 100644 --- a/tpu-client/src/nonblocking/tpu_client.rs +++ b/tpu-client/src/nonblocking/tpu_client.rs @@ -14,7 +14,7 @@ use { solana_pubsub_client::nonblocking::pubsub_client::{PubsubClient, PubsubClientError}, solana_rpc_client::{nonblocking::rpc_client::RpcClient, spinner}, solana_rpc_client_api::{ - client_error::{ClientError, Result as ClientResult}, + client_error::{Error as ClientError, Result as ClientResult}, request::MAX_GET_SIGNATURE_STATUSES_QUERY_ITEMS, response::{RpcContactInfo, SlotUpdate}, },