瀏覽代碼

Remove deprecated RpcClient methods (#1899)

* Remove deprecated RpcClient methods corresponding to #1809

* Remove internal handling for pre-v1.9.0 servers

* Remove unused import of deprecated_config module

* Remove request mapping (pre-v1.7.0)

* Remove dangling allow-deprecated tag

* Add line to changelog

* Remove deprecated RpcRequest variants

* Remove reprecated rpc-client-nonce-utils methods

* Remove deprecated TestValidator method

* Remove deprecated solana fees command
Tyera 1 年之前
父節點
當前提交
51af772e63

+ 1 - 0
CHANGELOG.md

@@ -28,6 +28,7 @@ Release channels have their own copy of this changelog:
     getConfirmedTransaction, getConfirmedSignaturesForAddress2, getRecentBlockhash, getFees,
     getConfirmedTransaction, getConfirmedSignaturesForAddress2, getRecentBlockhash, getFees,
     getFeeCalculatorForBlockhash, getFeeRateGovernor, getSnapshotSlot
     getFeeCalculatorForBlockhash, getFeeRateGovernor, getSnapshotSlot
   * `--enable-rpc-obsolete_v1_7` flag removed
   * `--enable-rpc-obsolete_v1_7` flag removed
+  * Deprecated methods are removed from `RpcClient` and `RpcClient::nonblocking`
 * Changes
 * Changes
   * `central-scheduler` as default option for `--block-production-method` (#34891)
   * `central-scheduler` as default option for `--block-production-method` (#34891)
   * `solana-rpc-client-api`: `RpcFilterError` depends on `base64` version 0.22, so users may need to upgrade to `base64` version 0.22
   * `solana-rpc-client-api`: `RpcFilterError` depends on `base64` version 0.22, so users may need to upgrade to `base64` version 0.22

+ 0 - 10
cli/src/cli.rs

@@ -65,9 +65,6 @@ pub enum CliCommand {
     ClusterVersion,
     ClusterVersion,
     Feature(FeatureCliCommand),
     Feature(FeatureCliCommand),
     Inflation(InflationCliCommand),
     Inflation(InflationCliCommand),
-    Fees {
-        blockhash: Option<Hash>,
-    },
     FindProgramDerivedAddress {
     FindProgramDerivedAddress {
         seeds: Vec<Vec<u8>>,
         seeds: Vec<Vec<u8>>,
         program_id: Pubkey,
         program_id: Pubkey,
@@ -640,12 +637,6 @@ pub fn parse_command(
         ("feature", Some(matches)) => {
         ("feature", Some(matches)) => {
             parse_feature_subcommand(matches, default_signer, wallet_manager)
             parse_feature_subcommand(matches, default_signer, wallet_manager)
         }
         }
-        ("fees", Some(matches)) => {
-            let blockhash = value_of::<Hash>(matches, "blockhash");
-            Ok(CliCommandInfo::without_signers(CliCommand::Fees {
-                blockhash,
-            }))
-        }
         ("first-available-block", Some(_matches)) => Ok(CliCommandInfo::without_signers(
         ("first-available-block", Some(_matches)) => Ok(CliCommandInfo::without_signers(
             CliCommand::FirstAvailableBlock,
             CliCommand::FirstAvailableBlock,
         )),
         )),
@@ -911,7 +902,6 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
             seed,
             seed,
             program_id,
             program_id,
         } => process_create_address_with_seed(config, from_pubkey.as_ref(), seed, program_id),
         } => process_create_address_with_seed(config, from_pubkey.as_ref(), seed, program_id),
-        CliCommand::Fees { ref blockhash } => process_fees(&rpc_client, config, blockhash.as_ref()),
         CliCommand::Feature(feature_subcommand) => {
         CliCommand::Feature(feature_subcommand) => {
             process_feature_subcommand(&rpc_client, config, feature_subcommand)
             process_feature_subcommand(&rpc_client, config, feature_subcommand)
         }
         }

+ 0 - 69
cli/src/cluster_query.rs

@@ -171,19 +171,6 @@ impl ClusterQuerySubCommands for App<'_, '_> {
             SubCommand::with_name("cluster-version")
             SubCommand::with_name("cluster-version")
                 .about("Get the version of the cluster entrypoint"),
                 .about("Get the version of the cluster entrypoint"),
         )
         )
-        // Deprecated in v1.8.0
-        .subcommand(
-            SubCommand::with_name("fees")
-                .about("Display current cluster fees (Deprecated in v1.8.0)")
-                .arg(
-                    Arg::with_name("blockhash")
-                        .long("blockhash")
-                        .takes_value(true)
-                        .value_name("BLOCKHASH")
-                        .validator(is_hash)
-                        .help("Query fees for BLOCKHASH instead of the most recent blockhash"),
-                ),
-        )
         .subcommand(
         .subcommand(
             SubCommand::with_name("first-available-block")
             SubCommand::with_name("first-available-block")
                 .about("Get the first available block in the storage"),
                 .about("Get the first available block in the storage"),
@@ -982,42 +969,6 @@ pub fn process_cluster_version(rpc_client: &RpcClient, config: &CliConfig) -> Pr
     }
     }
 }
 }
 
 
-pub fn process_fees(
-    rpc_client: &RpcClient,
-    config: &CliConfig,
-    blockhash: Option<&Hash>,
-) -> ProcessResult {
-    let fees = if let Some(recent_blockhash) = blockhash {
-        #[allow(deprecated)]
-        let result = rpc_client.get_fee_calculator_for_blockhash_with_commitment(
-            recent_blockhash,
-            config.commitment,
-        )?;
-        if let Some(fee_calculator) = result.value {
-            CliFees::some(
-                result.context.slot,
-                *recent_blockhash,
-                fee_calculator.lamports_per_signature,
-                None,
-                None,
-            )
-        } else {
-            CliFees::none()
-        }
-    } else {
-        #[allow(deprecated)]
-        let result = rpc_client.get_fees_with_commitment(config.commitment)?;
-        CliFees::some(
-            result.context.slot,
-            result.value.blockhash,
-            result.value.fee_calculator.lamports_per_signature,
-            None,
-            Some(result.value.last_valid_block_height),
-        )
-    };
-    Ok(config.output_format.formatted_string(&fees))
-}
-
 pub fn process_first_available_block(rpc_client: &RpcClient) -> ProcessResult {
 pub fn process_first_available_block(rpc_client: &RpcClient) -> ProcessResult {
     let first_available_block = rpc_client.get_first_available_block()?;
     let first_available_block = rpc_client.get_first_available_block()?;
     Ok(format!("{first_available_block}"))
     Ok(format!("{first_available_block}"))
@@ -2376,26 +2327,6 @@ mod tests {
             CliCommandInfo::without_signers(CliCommand::ClusterVersion)
             CliCommandInfo::without_signers(CliCommand::ClusterVersion)
         );
         );
 
 
-        let test_fees = test_commands.clone().get_matches_from(vec!["test", "fees"]);
-        assert_eq!(
-            parse_command(&test_fees, &default_signer, &mut None).unwrap(),
-            CliCommandInfo::without_signers(CliCommand::Fees { blockhash: None })
-        );
-
-        let blockhash = Hash::new_unique();
-        let test_fees = test_commands.clone().get_matches_from(vec![
-            "test",
-            "fees",
-            "--blockhash",
-            &blockhash.to_string(),
-        ]);
-        assert_eq!(
-            parse_command(&test_fees, &default_signer, &mut None).unwrap(),
-            CliCommandInfo::without_signers(CliCommand::Fees {
-                blockhash: Some(blockhash)
-            })
-        );
-
         let slot = 100;
         let slot = 100;
         let test_get_block_time =
         let test_get_block_time =
             test_commands
             test_commands

+ 4 - 72
rpc-client-api/src/request.rs

@@ -8,9 +8,7 @@ use {
 
 
 #[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
 #[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
 pub enum RpcRequest {
 pub enum RpcRequest {
-    Custom {
-        method: &'static str,
-    },
+    Custom { method: &'static str },
     DeregisterNode,
     DeregisterNode,
     GetAccountInfo,
     GetAccountInfo,
     GetBalance,
     GetBalance,
@@ -21,43 +19,9 @@ pub enum RpcRequest {
     GetBlocksWithLimit,
     GetBlocksWithLimit,
     GetBlockTime,
     GetBlockTime,
     GetClusterNodes,
     GetClusterNodes,
-    #[deprecated(since = "1.7.0", note = "Please use RpcRequest::GetBlock instead")]
-    GetConfirmedBlock,
-    #[deprecated(since = "1.7.0", note = "Please use RpcRequest::GetBlocks instead")]
-    GetConfirmedBlocks,
-    #[deprecated(
-        since = "1.7.0",
-        note = "Please use RpcRequest::GetBlocksWithLimit instead"
-    )]
-    GetConfirmedBlocksWithLimit,
-    #[deprecated(
-        since = "1.7.0",
-        note = "Please use RpcRequest::GetSignaturesForAddress instead"
-    )]
-    GetConfirmedSignaturesForAddress2,
-    #[deprecated(
-        since = "1.7.0",
-        note = "Please use RpcRequest::GetTransaction instead"
-    )]
-    GetConfirmedTransaction,
     GetEpochInfo,
     GetEpochInfo,
     GetEpochSchedule,
     GetEpochSchedule,
-    #[deprecated(
-        since = "1.9.0",
-        note = "Please use RpcRequest::GetFeeForMessage instead"
-    )]
-    GetFeeCalculatorForBlockhash,
     GetFeeForMessage,
     GetFeeForMessage,
-    #[deprecated(
-        since = "1.9.0",
-        note = "Please do not use, will no longer be available in the future"
-    )]
-    GetFeeRateGovernor,
-    #[deprecated(
-        since = "1.9.0",
-        note = "Please use RpcRequest::GetFeeForMessage instead"
-    )]
-    GetFees,
     GetFirstAvailableBlock,
     GetFirstAvailableBlock,
     GetGenesisHash,
     GetGenesisHash,
     GetHealth,
     GetHealth,
@@ -73,19 +37,9 @@ pub enum RpcRequest {
     GetMinimumBalanceForRentExemption,
     GetMinimumBalanceForRentExemption,
     GetMultipleAccounts,
     GetMultipleAccounts,
     GetProgramAccounts,
     GetProgramAccounts,
-    #[deprecated(
-        since = "1.9.0",
-        note = "Please use RpcRequest::GetLatestBlockhash instead"
-    )]
-    GetRecentBlockhash,
     GetRecentPerformanceSamples,
     GetRecentPerformanceSamples,
     GetRecentPrioritizationFees,
     GetRecentPrioritizationFees,
     GetHighestSnapshotSlot,
     GetHighestSnapshotSlot,
-    #[deprecated(
-        since = "1.9.0",
-        note = "Please use RpcRequest::GetHighestSnapshotSlot instead"
-    )]
-    GetSnapshotSlot,
     GetSignaturesForAddress,
     GetSignaturesForAddress,
     GetSignatureStatuses,
     GetSignatureStatuses,
     GetSlot,
     GetSlot,
@@ -131,17 +85,9 @@ impl fmt::Display for RpcRequest {
             RpcRequest::GetBlocksWithLimit => "getBlocksWithLimit",
             RpcRequest::GetBlocksWithLimit => "getBlocksWithLimit",
             RpcRequest::GetBlockTime => "getBlockTime",
             RpcRequest::GetBlockTime => "getBlockTime",
             RpcRequest::GetClusterNodes => "getClusterNodes",
             RpcRequest::GetClusterNodes => "getClusterNodes",
-            RpcRequest::GetConfirmedBlock => "getConfirmedBlock",
-            RpcRequest::GetConfirmedBlocks => "getConfirmedBlocks",
-            RpcRequest::GetConfirmedBlocksWithLimit => "getConfirmedBlocksWithLimit",
-            RpcRequest::GetConfirmedSignaturesForAddress2 => "getConfirmedSignaturesForAddress2",
-            RpcRequest::GetConfirmedTransaction => "getConfirmedTransaction",
             RpcRequest::GetEpochInfo => "getEpochInfo",
             RpcRequest::GetEpochInfo => "getEpochInfo",
             RpcRequest::GetEpochSchedule => "getEpochSchedule",
             RpcRequest::GetEpochSchedule => "getEpochSchedule",
-            RpcRequest::GetFeeCalculatorForBlockhash => "getFeeCalculatorForBlockhash",
             RpcRequest::GetFeeForMessage => "getFeeForMessage",
             RpcRequest::GetFeeForMessage => "getFeeForMessage",
-            RpcRequest::GetFeeRateGovernor => "getFeeRateGovernor",
-            RpcRequest::GetFees => "getFees",
             RpcRequest::GetFirstAvailableBlock => "getFirstAvailableBlock",
             RpcRequest::GetFirstAvailableBlock => "getFirstAvailableBlock",
             RpcRequest::GetGenesisHash => "getGenesisHash",
             RpcRequest::GetGenesisHash => "getGenesisHash",
             RpcRequest::GetHealth => "getHealth",
             RpcRequest::GetHealth => "getHealth",
@@ -157,11 +103,9 @@ impl fmt::Display for RpcRequest {
             RpcRequest::GetMinimumBalanceForRentExemption => "getMinimumBalanceForRentExemption",
             RpcRequest::GetMinimumBalanceForRentExemption => "getMinimumBalanceForRentExemption",
             RpcRequest::GetMultipleAccounts => "getMultipleAccounts",
             RpcRequest::GetMultipleAccounts => "getMultipleAccounts",
             RpcRequest::GetProgramAccounts => "getProgramAccounts",
             RpcRequest::GetProgramAccounts => "getProgramAccounts",
-            RpcRequest::GetRecentBlockhash => "getRecentBlockhash",
             RpcRequest::GetRecentPerformanceSamples => "getRecentPerformanceSamples",
             RpcRequest::GetRecentPerformanceSamples => "getRecentPerformanceSamples",
             RpcRequest::GetRecentPrioritizationFees => "getRecentPrioritizationFees",
             RpcRequest::GetRecentPrioritizationFees => "getRecentPrioritizationFees",
             RpcRequest::GetHighestSnapshotSlot => "getHighestSnapshotSlot",
             RpcRequest::GetHighestSnapshotSlot => "getHighestSnapshotSlot",
-            RpcRequest::GetSnapshotSlot => "getSnapshotSlot",
             RpcRequest::GetSignaturesForAddress => "getSignaturesForAddress",
             RpcRequest::GetSignaturesForAddress => "getSignaturesForAddress",
             RpcRequest::GetSignatureStatuses => "getSignatureStatuses",
             RpcRequest::GetSignatureStatuses => "getSignatureStatuses",
             RpcRequest::GetSlot => "getSlot",
             RpcRequest::GetSlot => "getSlot",
@@ -303,20 +247,9 @@ mod tests {
         let request = test_request.build_request_json(1, Value::Null);
         let request = test_request.build_request_json(1, Value::Null);
         assert_eq!(request["method"], "getEpochInfo");
         assert_eq!(request["method"], "getEpochInfo");
 
 
-        #[allow(deprecated)]
-        let test_request = RpcRequest::GetRecentBlockhash;
-        let request = test_request.build_request_json(1, Value::Null);
-        assert_eq!(request["method"], "getRecentBlockhash");
-
-        #[allow(deprecated)]
-        let test_request = RpcRequest::GetFeeCalculatorForBlockhash;
-        let request = test_request.build_request_json(1, json!([addr]));
-        assert_eq!(request["method"], "getFeeCalculatorForBlockhash");
-
-        #[allow(deprecated)]
-        let test_request = RpcRequest::GetFeeRateGovernor;
+        let test_request = RpcRequest::GetLatestBlockhash;
         let request = test_request.build_request_json(1, Value::Null);
         let request = test_request.build_request_json(1, Value::Null);
-        assert_eq!(request["method"], "getFeeRateGovernor");
+        assert_eq!(request["method"], "getLatestBlockhash");
 
 
         let test_request = RpcRequest::GetSlot;
         let test_request = RpcRequest::GetSlot;
         let request = test_request.build_request_json(1, Value::Null);
         let request = test_request.build_request_json(1, Value::Null);
@@ -347,8 +280,7 @@ mod tests {
         let addr = json!("deadbeefXjn8o3yroDHxUtKsZZgoy4GPkPPXfouKNHhx");
         let addr = json!("deadbeefXjn8o3yroDHxUtKsZZgoy4GPkPPXfouKNHhx");
 
 
         // Test request with CommitmentConfig and no params
         // Test request with CommitmentConfig and no params
-        #[allow(deprecated)]
-        let test_request = RpcRequest::GetRecentBlockhash;
+        let test_request = RpcRequest::GetLatestBlockhash;
         let request = test_request.build_request_json(1, json!([commitment_config]));
         let request = test_request.build_request_json(1, json!([commitment_config]));
         assert_eq!(request["params"], json!([commitment_config.clone()]));
         assert_eq!(request["params"], json!([commitment_config.clone()]));
 
 

+ 32 - 115
rpc-client-nonce-utils/src/blockhash_query.rs

@@ -6,10 +6,7 @@ use {
         offline::*,
         offline::*,
     },
     },
     solana_rpc_client::rpc_client::RpcClient,
     solana_rpc_client::rpc_client::RpcClient,
-    solana_sdk::{
-        commitment_config::CommitmentConfig, fee_calculator::FeeCalculator, hash::Hash,
-        pubkey::Pubkey,
-    },
+    solana_sdk::{commitment_config::CommitmentConfig, hash::Hash, pubkey::Pubkey},
 };
 };
 
 
 #[derive(Debug, PartialEq, Eq)]
 #[derive(Debug, PartialEq, Eq)]
@@ -19,56 +16,6 @@ pub enum Source {
 }
 }
 
 
 impl Source {
 impl Source {
-    #[deprecated(since = "1.9.0", note = "Please use `get_blockhash` instead")]
-    pub fn get_blockhash_and_fee_calculator(
-        &self,
-        rpc_client: &RpcClient,
-        commitment: CommitmentConfig,
-    ) -> Result<(Hash, FeeCalculator), Box<dyn std::error::Error>> {
-        match self {
-            Self::Cluster => {
-                #[allow(deprecated)]
-                let res = rpc_client
-                    .get_recent_blockhash_with_commitment(commitment)?
-                    .value;
-                Ok((res.0, res.1))
-            }
-            Self::NonceAccount(ref pubkey) => {
-                let data = crate::get_account_with_commitment(rpc_client, pubkey, commitment)
-                    .and_then(|ref a| crate::data_from_account(a))?;
-                Ok((data.blockhash(), data.fee_calculator))
-            }
-        }
-    }
-
-    #[deprecated(
-        since = "1.9.0",
-        note = "Please do not use, will no longer be available in the future"
-    )]
-    pub fn get_fee_calculator(
-        &self,
-        rpc_client: &RpcClient,
-        blockhash: &Hash,
-        commitment: CommitmentConfig,
-    ) -> Result<Option<FeeCalculator>, Box<dyn std::error::Error>> {
-        match self {
-            Self::Cluster => {
-                #[allow(deprecated)]
-                let res = rpc_client
-                    .get_fee_calculator_for_blockhash_with_commitment(blockhash, commitment)?
-                    .value;
-                Ok(res)
-            }
-            Self::NonceAccount(ref pubkey) => {
-                let res = crate::get_account_with_commitment(rpc_client, pubkey, commitment)?;
-                let res = crate::data_from_account(&res)?;
-                Ok(Some(res)
-                    .filter(|d| d.blockhash() == *blockhash)
-                    .map(|d| d.fee_calculator))
-            }
-        }
-    }
-
     pub fn get_blockhash(
     pub fn get_blockhash(
         &self,
         &self,
         rpc_client: &RpcClient,
         rpc_client: &RpcClient,
@@ -131,29 +78,6 @@ impl BlockhashQuery {
         BlockhashQuery::new(blockhash, sign_only, nonce_account)
         BlockhashQuery::new(blockhash, sign_only, nonce_account)
     }
     }
 
 
-    #[deprecated(since = "1.9.0", note = "Please use `get_blockhash` instead")]
-    pub fn get_blockhash_and_fee_calculator(
-        &self,
-        rpc_client: &RpcClient,
-        commitment: CommitmentConfig,
-    ) -> Result<(Hash, FeeCalculator), Box<dyn std::error::Error>> {
-        match self {
-            BlockhashQuery::None(hash) => Ok((*hash, FeeCalculator::default())),
-            BlockhashQuery::FeeCalculator(source, hash) => {
-                #[allow(deprecated)]
-                let fee_calculator = source
-                    .get_fee_calculator(rpc_client, hash, commitment)?
-                    .ok_or(format!("Hash has expired {hash:?}"))?;
-                Ok((*hash, fee_calculator))
-            }
-            BlockhashQuery::All(source) =>
-            {
-                #[allow(deprecated)]
-                source.get_blockhash_and_fee_calculator(rpc_client, commitment)
-            }
-        }
-    }
-
     pub fn get_blockhash(
     pub fn get_blockhash(
         &self,
         &self,
         rpc_client: &RpcClient,
         rpc_client: &RpcClient,
@@ -188,10 +112,11 @@ mod tests {
         solana_account_decoder::{UiAccount, UiAccountEncoding},
         solana_account_decoder::{UiAccount, UiAccountEncoding},
         solana_rpc_client_api::{
         solana_rpc_client_api::{
             request::RpcRequest,
             request::RpcRequest,
-            response::{Response, RpcFeeCalculator, RpcFees, RpcResponseContext},
+            response::{Response, RpcBlockhash, RpcResponseContext},
         },
         },
         solana_sdk::{
         solana_sdk::{
             account::Account,
             account::Account,
+            fee_calculator::FeeCalculator,
             hash::hash,
             hash::hash,
             nonce::{self, state::DurableNonce},
             nonce::{self, state::DurableNonce},
             system_program,
             system_program,
@@ -350,65 +275,65 @@ mod tests {
 
 
     #[test]
     #[test]
     #[allow(deprecated)]
     #[allow(deprecated)]
-    fn test_blockhash_query_get_blockhash_fee_calc() {
+    fn test_blockhash_query_get_blockhash() {
         let test_blockhash = hash(&[0u8]);
         let test_blockhash = hash(&[0u8]);
         let rpc_blockhash = hash(&[1u8]);
         let rpc_blockhash = hash(&[1u8]);
-        let rpc_fee_calc = FeeCalculator::new(42);
-        let get_recent_blockhash_response = json!(Response {
+        let get_latest_blockhash_response = json!(Response {
             context: RpcResponseContext {
             context: RpcResponseContext {
                 slot: 1,
                 slot: 1,
                 api_version: None
                 api_version: None
             },
             },
-            value: json!(RpcFees {
+            value: json!(RpcBlockhash {
                 blockhash: rpc_blockhash.to_string(),
                 blockhash: rpc_blockhash.to_string(),
-                fee_calculator: rpc_fee_calc,
-                last_valid_slot: 42,
                 last_valid_block_height: 42,
                 last_valid_block_height: 42,
             }),
             }),
         });
         });
-        let get_fee_calculator_for_blockhash_response = json!(Response {
+        let is_blockhash_valid_response = json!(Response {
             context: RpcResponseContext {
             context: RpcResponseContext {
                 slot: 1,
                 slot: 1,
                 api_version: None
                 api_version: None
             },
             },
-            value: json!(RpcFeeCalculator {
-                fee_calculator: rpc_fee_calc
-            }),
+            value: true,
         });
         });
         let mut mocks = HashMap::new();
         let mut mocks = HashMap::new();
-        mocks.insert(RpcRequest::GetFees, get_recent_blockhash_response.clone());
+        mocks.insert(
+            RpcRequest::GetLatestBlockhash,
+            get_latest_blockhash_response.clone(),
+        );
         let rpc_client = RpcClient::new_mock_with_mocks("".to_string(), mocks);
         let rpc_client = RpcClient::new_mock_with_mocks("".to_string(), mocks);
         assert_eq!(
         assert_eq!(
             BlockhashQuery::default()
             BlockhashQuery::default()
-                .get_blockhash_and_fee_calculator(&rpc_client, CommitmentConfig::default())
+                .get_blockhash(&rpc_client, CommitmentConfig::default())
                 .unwrap(),
                 .unwrap(),
-            (rpc_blockhash, rpc_fee_calc),
+            rpc_blockhash,
         );
         );
         let mut mocks = HashMap::new();
         let mut mocks = HashMap::new();
-        mocks.insert(RpcRequest::GetFees, get_recent_blockhash_response.clone());
         mocks.insert(
         mocks.insert(
-            RpcRequest::GetFeeCalculatorForBlockhash,
-            get_fee_calculator_for_blockhash_response,
+            RpcRequest::IsBlockhashValid,
+            is_blockhash_valid_response.clone(),
         );
         );
         let rpc_client = RpcClient::new_mock_with_mocks("".to_string(), mocks);
         let rpc_client = RpcClient::new_mock_with_mocks("".to_string(), mocks);
         assert_eq!(
         assert_eq!(
             BlockhashQuery::FeeCalculator(Source::Cluster, test_blockhash)
             BlockhashQuery::FeeCalculator(Source::Cluster, test_blockhash)
-                .get_blockhash_and_fee_calculator(&rpc_client, CommitmentConfig::default())
+                .get_blockhash(&rpc_client, CommitmentConfig::default())
                 .unwrap(),
                 .unwrap(),
-            (test_blockhash, rpc_fee_calc),
+            test_blockhash,
         );
         );
         let mut mocks = HashMap::new();
         let mut mocks = HashMap::new();
-        mocks.insert(RpcRequest::GetFees, get_recent_blockhash_response);
+        mocks.insert(
+            RpcRequest::GetLatestBlockhash,
+            get_latest_blockhash_response,
+        );
         let rpc_client = RpcClient::new_mock_with_mocks("".to_string(), mocks);
         let rpc_client = RpcClient::new_mock_with_mocks("".to_string(), mocks);
         assert_eq!(
         assert_eq!(
             BlockhashQuery::None(test_blockhash)
             BlockhashQuery::None(test_blockhash)
-                .get_blockhash_and_fee_calculator(&rpc_client, CommitmentConfig::default())
+                .get_blockhash(&rpc_client, CommitmentConfig::default())
                 .unwrap(),
                 .unwrap(),
-            (test_blockhash, FeeCalculator::default()),
+            test_blockhash,
         );
         );
         let rpc_client = RpcClient::new_mock("fails".to_string());
         let rpc_client = RpcClient::new_mock("fails".to_string());
         assert!(BlockhashQuery::default()
         assert!(BlockhashQuery::default()
-            .get_blockhash_and_fee_calculator(&rpc_client, CommitmentConfig::default())
+            .get_blockhash(&rpc_client, CommitmentConfig::default())
             .is_err());
             .is_err());
 
 
         let durable_nonce = DurableNonce::from_blockhash(&Hash::new(&[2u8; 32]));
         let durable_nonce = DurableNonce::from_blockhash(&Hash::new(&[2u8; 32]));
@@ -447,40 +372,32 @@ mod tests {
         let rpc_client = RpcClient::new_mock_with_mocks("".to_string(), mocks);
         let rpc_client = RpcClient::new_mock_with_mocks("".to_string(), mocks);
         assert_eq!(
         assert_eq!(
             BlockhashQuery::All(Source::NonceAccount(nonce_pubkey))
             BlockhashQuery::All(Source::NonceAccount(nonce_pubkey))
-                .get_blockhash_and_fee_calculator(&rpc_client, CommitmentConfig::default())
+                .get_blockhash(&rpc_client, CommitmentConfig::default())
                 .unwrap(),
                 .unwrap(),
-            (nonce_blockhash, nonce_fee_calc),
+            nonce_blockhash,
         );
         );
         let mut mocks = HashMap::new();
         let mut mocks = HashMap::new();
         mocks.insert(RpcRequest::GetAccountInfo, get_account_response.clone());
         mocks.insert(RpcRequest::GetAccountInfo, get_account_response.clone());
         let rpc_client = RpcClient::new_mock_with_mocks("".to_string(), mocks);
         let rpc_client = RpcClient::new_mock_with_mocks("".to_string(), mocks);
         assert_eq!(
         assert_eq!(
             BlockhashQuery::FeeCalculator(Source::NonceAccount(nonce_pubkey), nonce_blockhash)
             BlockhashQuery::FeeCalculator(Source::NonceAccount(nonce_pubkey), nonce_blockhash)
-                .get_blockhash_and_fee_calculator(&rpc_client, CommitmentConfig::default())
+                .get_blockhash(&rpc_client, CommitmentConfig::default())
                 .unwrap(),
                 .unwrap(),
-            (nonce_blockhash, nonce_fee_calc),
-        );
-        let mut mocks = HashMap::new();
-        mocks.insert(RpcRequest::GetAccountInfo, get_account_response.clone());
-        let rpc_client = RpcClient::new_mock_with_mocks("".to_string(), mocks);
-        assert!(
-            BlockhashQuery::FeeCalculator(Source::NonceAccount(nonce_pubkey), test_blockhash)
-                .get_blockhash_and_fee_calculator(&rpc_client, CommitmentConfig::default())
-                .is_err()
+            nonce_blockhash,
         );
         );
         let mut mocks = HashMap::new();
         let mut mocks = HashMap::new();
         mocks.insert(RpcRequest::GetAccountInfo, get_account_response);
         mocks.insert(RpcRequest::GetAccountInfo, get_account_response);
         let rpc_client = RpcClient::new_mock_with_mocks("".to_string(), mocks);
         let rpc_client = RpcClient::new_mock_with_mocks("".to_string(), mocks);
         assert_eq!(
         assert_eq!(
             BlockhashQuery::None(nonce_blockhash)
             BlockhashQuery::None(nonce_blockhash)
-                .get_blockhash_and_fee_calculator(&rpc_client, CommitmentConfig::default())
+                .get_blockhash(&rpc_client, CommitmentConfig::default())
                 .unwrap(),
                 .unwrap(),
-            (nonce_blockhash, FeeCalculator::default()),
+            nonce_blockhash,
         );
         );
 
 
         let rpc_client = RpcClient::new_mock("fails".to_string());
         let rpc_client = RpcClient::new_mock("fails".to_string());
         assert!(BlockhashQuery::All(Source::NonceAccount(nonce_pubkey))
         assert!(BlockhashQuery::All(Source::NonceAccount(nonce_pubkey))
-            .get_blockhash_and_fee_calculator(&rpc_client, CommitmentConfig::default())
+            .get_blockhash(&rpc_client, CommitmentConfig::default())
             .is_err());
             .is_err());
     }
     }
 }
 }

+ 39 - 548
rpc-client/src/nonblocking/rpc_client.rs

@@ -7,11 +7,6 @@
 //! [JSON-RPC]: https://www.jsonrpc.org/specification
 //! [JSON-RPC]: https://www.jsonrpc.org/specification
 
 
 pub use crate::mock_sender::Mocks;
 pub use crate::mock_sender::Mocks;
-#[allow(deprecated)]
-use solana_rpc_client_api::deprecated_config::{
-    RpcConfirmedBlockConfig, RpcConfirmedTransactionConfig,
-    RpcGetConfirmedSignaturesForAddress2Config,
-};
 #[cfg(feature = "spinner")]
 #[cfg(feature = "spinner")]
 use {crate::spinner, solana_sdk::clock::MAX_HASH_AGE_IN_SECONDS, std::cmp::min};
 use {crate::spinner, solana_sdk::clock::MAX_HASH_AGE_IN_SECONDS, std::cmp::min};
 use {
 use {
@@ -47,7 +42,6 @@ use {
         commitment_config::{CommitmentConfig, CommitmentLevel},
         commitment_config::{CommitmentConfig, CommitmentLevel},
         epoch_info::EpochInfo,
         epoch_info::EpochInfo,
         epoch_schedule::EpochSchedule,
         epoch_schedule::EpochSchedule,
-        fee_calculator::{FeeCalculator, FeeRateGovernor},
         hash::Hash,
         hash::Hash,
         pubkey::Pubkey,
         pubkey::Pubkey,
         signature::Signature,
         signature::Signature,
@@ -576,23 +570,6 @@ impl RpcClient {
         Ok(requested_commitment)
         Ok(requested_commitment)
     }
     }
 
 
-    #[allow(deprecated)]
-    async fn maybe_map_request(&self, mut request: RpcRequest) -> Result<RpcRequest, RpcError> {
-        if self.get_node_version().await? < semver::Version::new(1, 7, 0) {
-            request = match request {
-                RpcRequest::GetBlock => RpcRequest::GetConfirmedBlock,
-                RpcRequest::GetBlocks => RpcRequest::GetConfirmedBlocks,
-                RpcRequest::GetBlocksWithLimit => RpcRequest::GetConfirmedBlocksWithLimit,
-                RpcRequest::GetSignaturesForAddress => {
-                    RpcRequest::GetConfirmedSignaturesForAddress2
-                }
-                RpcRequest::GetTransaction => RpcRequest::GetConfirmedTransaction,
-                _ => request,
-            };
-        }
-        Ok(request)
-    }
-
     #[allow(deprecated)]
     #[allow(deprecated)]
     async fn maybe_map_filters(
     async fn maybe_map_filters(
         &self,
         &self,
@@ -1436,27 +1413,8 @@ impl RpcClient {
     /// # Ok::<(), Error>(())
     /// # Ok::<(), Error>(())
     /// ```
     /// ```
     pub async fn get_highest_snapshot_slot(&self) -> ClientResult<RpcSnapshotSlotInfo> {
     pub async fn get_highest_snapshot_slot(&self) -> ClientResult<RpcSnapshotSlotInfo> {
-        if self.get_node_version().await? < semver::Version::new(1, 9, 0) {
-            #[allow(deprecated)]
-            self.get_snapshot_slot()
-                .await
-                .map(|full| RpcSnapshotSlotInfo {
-                    full,
-                    incremental: None,
-                })
-        } else {
-            self.send(RpcRequest::GetHighestSnapshotSlot, Value::Null)
-                .await
-        }
-    }
-
-    #[deprecated(
-        since = "1.8.0",
-        note = "Please use RpcClient::get_highest_snapshot_slot() instead"
-    )]
-    #[allow(deprecated)]
-    pub async fn get_snapshot_slot(&self) -> ClientResult<Slot> {
-        self.send(RpcRequest::GetSnapshotSlot, Value::Null).await
+        self.send(RpcRequest::GetHighestSnapshotSlot, Value::Null)
+            .await
     }
     }
 
 
     /// Check if a transaction has been processed with the default [commitment level][cl].
     /// Check if a transaction has been processed with the default [commitment level][cl].
@@ -2519,11 +2477,8 @@ impl RpcClient {
         slot: Slot,
         slot: Slot,
         encoding: UiTransactionEncoding,
         encoding: UiTransactionEncoding,
     ) -> ClientResult<EncodedConfirmedBlock> {
     ) -> ClientResult<EncodedConfirmedBlock> {
-        self.send(
-            self.maybe_map_request(RpcRequest::GetBlock).await?,
-            json!([slot, encoding]),
-        )
-        .await
+        self.send(RpcRequest::GetBlock, json!([slot, encoding]))
+            .await
     }
     }
 
 
     /// Returns identity and transaction information about a confirmed block in the ledger.
     /// Returns identity and transaction information about a confirmed block in the ledger.
@@ -2569,46 +2524,7 @@ impl RpcClient {
         slot: Slot,
         slot: Slot,
         config: RpcBlockConfig,
         config: RpcBlockConfig,
     ) -> ClientResult<UiConfirmedBlock> {
     ) -> ClientResult<UiConfirmedBlock> {
-        self.send(
-            self.maybe_map_request(RpcRequest::GetBlock).await?,
-            json!([slot, config]),
-        )
-        .await
-    }
-
-    #[deprecated(since = "1.7.0", note = "Please use RpcClient::get_block() instead")]
-    #[allow(deprecated)]
-    pub async fn get_confirmed_block(&self, slot: Slot) -> ClientResult<EncodedConfirmedBlock> {
-        self.get_confirmed_block_with_encoding(slot, UiTransactionEncoding::Json)
-            .await
-    }
-
-    #[deprecated(
-        since = "1.7.0",
-        note = "Please use RpcClient::get_block_with_encoding() instead"
-    )]
-    #[allow(deprecated)]
-    pub async fn get_confirmed_block_with_encoding(
-        &self,
-        slot: Slot,
-        encoding: UiTransactionEncoding,
-    ) -> ClientResult<EncodedConfirmedBlock> {
-        self.send(RpcRequest::GetConfirmedBlock, json!([slot, encoding]))
-            .await
-    }
-
-    #[deprecated(
-        since = "1.7.0",
-        note = "Please use RpcClient::get_block_with_config() instead"
-    )]
-    #[allow(deprecated)]
-    pub async fn get_confirmed_block_with_config(
-        &self,
-        slot: Slot,
-        config: RpcConfirmedBlockConfig,
-    ) -> ClientResult<UiConfirmedBlock> {
-        self.send(RpcRequest::GetConfirmedBlock, json!([slot, config]))
-            .await
+        self.send(RpcRequest::GetBlock, json!([slot, config])).await
     }
     }
 
 
     /// Returns a list of finalized blocks between two slots.
     /// Returns a list of finalized blocks between two slots.
@@ -2635,12 +2551,9 @@ impl RpcClient {
     ///
     ///
     /// # RPC Reference
     /// # RPC Reference
     ///
     ///
-    /// This method corresponds directly to the [`getBlocks`] RPC method, unless
-    /// the remote node version is less than 1.7, in which case it maps to the
-    /// [`getConfirmedBlocks`] RPC method.
+    /// This method corresponds directly to the [`getBlocks`] RPC method.
     ///
     ///
     /// [`getBlocks`]: https://solana.com/docs/rpc/http/getblocks
     /// [`getBlocks`]: https://solana.com/docs/rpc/http/getblocks
-    /// [`getConfirmedBlocks`]: https://solana.com/docs/rpc/deprecated/getconfirmedblocks
     ///
     ///
     /// # Examples
     /// # Examples
     ///
     ///
@@ -2662,11 +2575,8 @@ impl RpcClient {
         start_slot: Slot,
         start_slot: Slot,
         end_slot: Option<Slot>,
         end_slot: Option<Slot>,
     ) -> ClientResult<Vec<Slot>> {
     ) -> ClientResult<Vec<Slot>> {
-        self.send(
-            self.maybe_map_request(RpcRequest::GetBlocks).await?,
-            json!([start_slot, end_slot]),
-        )
-        .await
+        self.send(RpcRequest::GetBlocks, json!([start_slot, end_slot]))
+            .await
     }
     }
 
 
     /// Returns a list of confirmed blocks between two slots.
     /// Returns a list of confirmed blocks between two slots.
@@ -2697,12 +2607,9 @@ impl RpcClient {
     ///
     ///
     /// # RPC Reference
     /// # RPC Reference
     ///
     ///
-    /// This method corresponds directly to the [`getBlocks`] RPC method, unless
-    /// the remote node version is less than 1.7, in which case it maps to the
-    /// [`getConfirmedBlocks`] RPC method.
+    /// This method corresponds directly to the [`getBlocks`] RPC method.
     ///
     ///
     /// [`getBlocks`]: https://solana.com/docs/rpc/http/getblocks
     /// [`getBlocks`]: https://solana.com/docs/rpc/http/getblocks
-    /// [`getConfirmedBlocks`]: https://solana.com/docs/rpc/deprecated/getconfirmedblocks
     ///
     ///
     /// # Examples
     /// # Examples
     ///
     ///
@@ -2744,8 +2651,7 @@ impl RpcClient {
                 self.maybe_map_commitment(commitment_config).await?
                 self.maybe_map_commitment(commitment_config).await?
             ])
             ])
         };
         };
-        self.send(self.maybe_map_request(RpcRequest::GetBlocks).await?, json)
-            .await
+        self.send(RpcRequest::GetBlocks, json).await
     }
     }
 
 
     /// Returns a list of finalized blocks starting at the given slot.
     /// Returns a list of finalized blocks starting at the given slot.
@@ -2762,11 +2668,9 @@ impl RpcClient {
     /// # RPC Reference
     /// # RPC Reference
     ///
     ///
     /// This method corresponds directly to the [`getBlocksWithLimit`] RPC
     /// This method corresponds directly to the [`getBlocksWithLimit`] RPC
-    /// method, unless the remote node version is less than 1.7, in which case
-    /// it maps to the [`getConfirmedBlocksWithLimit`] RPC method.
+    /// method.
     ///
     ///
     /// [`getBlocksWithLimit`]: https://solana.com/docs/rpc/http/getblockswithlimit
     /// [`getBlocksWithLimit`]: https://solana.com/docs/rpc/http/getblockswithlimit
-    /// [`getConfirmedBlocksWithLimit`]: https://solana.com/docs/rpc/deprecated/getconfirmedblockswithlimit
     ///
     ///
     /// # Examples
     /// # Examples
     ///
     ///
@@ -2788,12 +2692,8 @@ impl RpcClient {
         start_slot: Slot,
         start_slot: Slot,
         limit: usize,
         limit: usize,
     ) -> ClientResult<Vec<Slot>> {
     ) -> ClientResult<Vec<Slot>> {
-        self.send(
-            self.maybe_map_request(RpcRequest::GetBlocksWithLimit)
-                .await?,
-            json!([start_slot, limit]),
-        )
-        .await
+        self.send(RpcRequest::GetBlocksWithLimit, json!([start_slot, limit]))
+            .await
     }
     }
 
 
     /// Returns a list of confirmed blocks starting at the given slot.
     /// Returns a list of confirmed blocks starting at the given slot.
@@ -2811,11 +2711,9 @@ impl RpcClient {
     /// # RPC Reference
     /// # RPC Reference
     ///
     ///
     /// This method corresponds directly to the [`getBlocksWithLimit`] RPC
     /// This method corresponds directly to the [`getBlocksWithLimit`] RPC
-    /// method, unless the remote node version is less than 1.7, in which case
-    /// it maps to the `getConfirmedBlocksWithLimit` RPC method.
+    /// method.
     ///
     ///
     /// [`getBlocksWithLimit`]: https://solana.com/docs/rpc/http/getblockswithlimit
     /// [`getBlocksWithLimit`]: https://solana.com/docs/rpc/http/getblockswithlimit
-    /// [`getConfirmedBlocksWithLimit`]: https://solana.com/docs/rpc/deprecated/getconfirmedblockswithlimit
     ///
     ///
     /// # Examples
     /// # Examples
     ///
     ///
@@ -2845,87 +2743,7 @@ impl RpcClient {
         commitment_config: CommitmentConfig,
         commitment_config: CommitmentConfig,
     ) -> ClientResult<Vec<Slot>> {
     ) -> ClientResult<Vec<Slot>> {
         self.send(
         self.send(
-            self.maybe_map_request(RpcRequest::GetBlocksWithLimit)
-                .await?,
-            json!([
-                start_slot,
-                limit,
-                self.maybe_map_commitment(commitment_config).await?
-            ]),
-        )
-        .await
-    }
-
-    #[deprecated(since = "1.7.0", note = "Please use RpcClient::get_blocks() instead")]
-    #[allow(deprecated)]
-    pub async fn get_confirmed_blocks(
-        &self,
-        start_slot: Slot,
-        end_slot: Option<Slot>,
-    ) -> ClientResult<Vec<Slot>> {
-        self.send(
-            RpcRequest::GetConfirmedBlocks,
-            json!([start_slot, end_slot]),
-        )
-        .await
-    }
-
-    #[deprecated(
-        since = "1.7.0",
-        note = "Please use RpcClient::get_blocks_with_commitment() instead"
-    )]
-    #[allow(deprecated)]
-    pub async fn get_confirmed_blocks_with_commitment(
-        &self,
-        start_slot: Slot,
-        end_slot: Option<Slot>,
-        commitment_config: CommitmentConfig,
-    ) -> ClientResult<Vec<Slot>> {
-        let json = if end_slot.is_some() {
-            json!([
-                start_slot,
-                end_slot,
-                self.maybe_map_commitment(commitment_config).await?
-            ])
-        } else {
-            json!([
-                start_slot,
-                self.maybe_map_commitment(commitment_config).await?
-            ])
-        };
-        self.send(RpcRequest::GetConfirmedBlocks, json).await
-    }
-
-    #[deprecated(
-        since = "1.7.0",
-        note = "Please use RpcClient::get_blocks_with_limit() instead"
-    )]
-    #[allow(deprecated)]
-    pub async fn get_confirmed_blocks_with_limit(
-        &self,
-        start_slot: Slot,
-        limit: usize,
-    ) -> ClientResult<Vec<Slot>> {
-        self.send(
-            RpcRequest::GetConfirmedBlocksWithLimit,
-            json!([start_slot, limit]),
-        )
-        .await
-    }
-
-    #[deprecated(
-        since = "1.7.0",
-        note = "Please use RpcClient::get_blocks_with_limit_and_commitment() instead"
-    )]
-    #[allow(deprecated)]
-    pub async fn get_confirmed_blocks_with_limit_and_commitment(
-        &self,
-        start_slot: Slot,
-        limit: usize,
-        commitment_config: CommitmentConfig,
-    ) -> ClientResult<Vec<Slot>> {
-        self.send(
-            RpcRequest::GetConfirmedBlocksWithLimit,
+            RpcRequest::GetBlocksWithLimit,
             json!([
             json!([
                 start_slot,
                 start_slot,
                 limit,
                 limit,
@@ -3050,51 +2868,7 @@ impl RpcClient {
 
 
         let result: Vec<RpcConfirmedTransactionStatusWithSignature> = self
         let result: Vec<RpcConfirmedTransactionStatusWithSignature> = self
             .send(
             .send(
-                self.maybe_map_request(RpcRequest::GetSignaturesForAddress)
-                    .await?,
-                json!([address.to_string(), config]),
-            )
-            .await?;
-
-        Ok(result)
-    }
-
-    #[deprecated(
-        since = "1.7.0",
-        note = "Please use RpcClient::get_signatures_for_address() instead"
-    )]
-    #[allow(deprecated)]
-    pub async fn get_confirmed_signatures_for_address2(
-        &self,
-        address: &Pubkey,
-    ) -> ClientResult<Vec<RpcConfirmedTransactionStatusWithSignature>> {
-        self.get_confirmed_signatures_for_address2_with_config(
-            address,
-            GetConfirmedSignaturesForAddress2Config::default(),
-        )
-        .await
-    }
-
-    #[deprecated(
-        since = "1.7.0",
-        note = "Please use RpcClient::get_signatures_for_address_with_config() instead"
-    )]
-    #[allow(deprecated)]
-    pub async fn get_confirmed_signatures_for_address2_with_config(
-        &self,
-        address: &Pubkey,
-        config: GetConfirmedSignaturesForAddress2Config,
-    ) -> ClientResult<Vec<RpcConfirmedTransactionStatusWithSignature>> {
-        let config = RpcGetConfirmedSignaturesForAddress2Config {
-            before: config.before.map(|signature| signature.to_string()),
-            until: config.until.map(|signature| signature.to_string()),
-            limit: config.limit,
-            commitment: config.commitment,
-        };
-
-        let result: Vec<RpcConfirmedTransactionStatusWithSignature> = self
-            .send(
-                RpcRequest::GetConfirmedSignaturesForAddress2,
+                RpcRequest::GetSignaturesForAddress,
                 json!([address.to_string(), config]),
                 json!([address.to_string(), config]),
             )
             )
             .await?;
             .await?;
@@ -3111,12 +2885,9 @@ impl RpcClient {
     ///
     ///
     /// # RPC Reference
     /// # RPC Reference
     ///
     ///
-    /// This method corresponds directly to the [`getTransaction`] RPC method,
-    /// unless the remote node version is less than 1.7, in which case it maps
-    /// to the [`getConfirmedTransaction`] RPC method.
+    /// This method corresponds directly to the [`getTransaction`] RPC method.
     ///
     ///
     /// [`getTransaction`]: https://solana.com/docs/rpc/http/gettransaction
     /// [`getTransaction`]: https://solana.com/docs/rpc/http/gettransaction
-    /// [`getConfirmedTransaction`]: https://solana.com/docs/rpc/deprecated/getConfirmedTransaction
     ///
     ///
     /// # Examples
     /// # Examples
     ///
     ///
@@ -3152,7 +2923,7 @@ impl RpcClient {
         encoding: UiTransactionEncoding,
         encoding: UiTransactionEncoding,
     ) -> ClientResult<EncodedConfirmedTransactionWithStatusMeta> {
     ) -> ClientResult<EncodedConfirmedTransactionWithStatusMeta> {
         self.send(
         self.send(
-            self.maybe_map_request(RpcRequest::GetTransaction).await?,
+            RpcRequest::GetTransaction,
             json!([signature.to_string(), encoding]),
             json!([signature.to_string(), encoding]),
         )
         )
         .await
         .await
@@ -3170,12 +2941,9 @@ impl RpcClient {
     ///
     ///
     /// # RPC Reference
     /// # RPC Reference
     ///
     ///
-    /// This method corresponds directly to the [`getTransaction`] RPC method,
-    /// unless the remote node version is less than 1.7, in which case it maps
-    /// to the [`getConfirmedTransaction`] RPC method.
+    /// This method corresponds directly to the [`getTransaction`] RPC method.
     ///
     ///
     /// [`getTransaction`]: https://solana.com/docs/rpc/http/gettransaction
     /// [`getTransaction`]: https://solana.com/docs/rpc/http/gettransaction
-    /// [`getConfirmedTransaction`]: https://solana.com/docs/rpc/deprecated/getConfirmedTransaction
     ///
     ///
     /// # Examples
     /// # Examples
     ///
     ///
@@ -3220,41 +2988,7 @@ impl RpcClient {
         config: RpcTransactionConfig,
         config: RpcTransactionConfig,
     ) -> ClientResult<EncodedConfirmedTransactionWithStatusMeta> {
     ) -> ClientResult<EncodedConfirmedTransactionWithStatusMeta> {
         self.send(
         self.send(
-            self.maybe_map_request(RpcRequest::GetTransaction).await?,
-            json!([signature.to_string(), config]),
-        )
-        .await
-    }
-
-    #[deprecated(
-        since = "1.7.0",
-        note = "Please use RpcClient::get_transaction() instead"
-    )]
-    #[allow(deprecated)]
-    pub async fn get_confirmed_transaction(
-        &self,
-        signature: &Signature,
-        encoding: UiTransactionEncoding,
-    ) -> ClientResult<EncodedConfirmedTransactionWithStatusMeta> {
-        self.send(
-            RpcRequest::GetConfirmedTransaction,
-            json!([signature.to_string(), encoding]),
-        )
-        .await
-    }
-
-    #[deprecated(
-        since = "1.7.0",
-        note = "Please use RpcClient::get_transaction_with_config() instead"
-    )]
-    #[allow(deprecated)]
-    pub async fn get_confirmed_transaction_with_config(
-        &self,
-        signature: &Signature,
-        config: RpcConfirmedTransactionConfig,
-    ) -> ClientResult<EncodedConfirmedTransactionWithStatusMeta> {
-        self.send(
-            RpcRequest::GetConfirmedTransaction,
+            RpcRequest::GetTransaction,
             json!([signature.to_string(), config]),
             json!([signature.to_string(), config]),
         )
         )
         .await
         .await
@@ -4549,228 +4283,6 @@ impl RpcClient {
         .await
         .await
     }
     }
 
 
-    #[deprecated(
-        since = "1.9.0",
-        note = "Please use `get_latest_blockhash` and `get_fee_for_message` instead"
-    )]
-    #[allow(deprecated)]
-    pub async fn get_fees(&self) -> ClientResult<Fees> {
-        #[allow(deprecated)]
-        Ok(self
-            .get_fees_with_commitment(self.commitment())
-            .await?
-            .value)
-    }
-
-    #[deprecated(
-        since = "1.9.0",
-        note = "Please use `get_latest_blockhash_with_commitment` and `get_fee_for_message` instead"
-    )]
-    #[allow(deprecated)]
-    pub async fn get_fees_with_commitment(
-        &self,
-        commitment_config: CommitmentConfig,
-    ) -> RpcResult<Fees> {
-        let Response {
-            context,
-            value: fees,
-        } = self
-            .send::<Response<RpcFees>>(
-                RpcRequest::GetFees,
-                json!([self.maybe_map_commitment(commitment_config).await?]),
-            )
-            .await?;
-        let blockhash = fees.blockhash.parse().map_err(|_| {
-            ClientError::new_with_request(
-                RpcError::ParseError("Hash".to_string()).into(),
-                RpcRequest::GetFees,
-            )
-        })?;
-        Ok(Response {
-            context,
-            value: Fees {
-                blockhash,
-                fee_calculator: fees.fee_calculator,
-                last_valid_block_height: fees.last_valid_block_height,
-            },
-        })
-    }
-
-    #[deprecated(since = "1.9.0", note = "Please use `get_latest_blockhash` instead")]
-    #[allow(deprecated)]
-    pub async fn get_recent_blockhash(&self) -> ClientResult<(Hash, FeeCalculator)> {
-        #[allow(deprecated)]
-        let (blockhash, fee_calculator, _last_valid_slot) = self
-            .get_recent_blockhash_with_commitment(self.commitment())
-            .await?
-            .value;
-        Ok((blockhash, fee_calculator))
-    }
-
-    #[deprecated(
-        since = "1.9.0",
-        note = "Please use `get_latest_blockhash_with_commitment` instead"
-    )]
-    #[allow(deprecated)]
-    pub async fn get_recent_blockhash_with_commitment(
-        &self,
-        commitment_config: CommitmentConfig,
-    ) -> RpcResult<(Hash, FeeCalculator, Slot)> {
-        let (context, blockhash, fee_calculator, last_valid_slot) = if let Ok(Response {
-            context,
-            value:
-                RpcFees {
-                    blockhash,
-                    fee_calculator,
-                    last_valid_slot,
-                    ..
-                },
-        }) = self
-            .send::<Response<RpcFees>>(
-                RpcRequest::GetFees,
-                json!([self.maybe_map_commitment(commitment_config).await?]),
-            )
-            .await
-        {
-            (context, blockhash, fee_calculator, last_valid_slot)
-        } else if let Ok(Response {
-            context,
-            value:
-                DeprecatedRpcFees {
-                    blockhash,
-                    fee_calculator,
-                    last_valid_slot,
-                },
-        }) = self
-            .send::<Response<DeprecatedRpcFees>>(
-                RpcRequest::GetFees,
-                json!([self.maybe_map_commitment(commitment_config).await?]),
-            )
-            .await
-        {
-            (context, blockhash, fee_calculator, last_valid_slot)
-        } else if let Ok(Response {
-            context,
-            value:
-                RpcBlockhashFeeCalculator {
-                    blockhash,
-                    fee_calculator,
-                },
-        }) = self
-            .send::<Response<RpcBlockhashFeeCalculator>>(
-                RpcRequest::GetRecentBlockhash,
-                json!([self.maybe_map_commitment(commitment_config).await?]),
-            )
-            .await
-        {
-            (context, blockhash, fee_calculator, 0)
-        } else {
-            return Err(ClientError::new_with_request(
-                RpcError::ParseError("RpcBlockhashFeeCalculator or RpcFees".to_string()).into(),
-                RpcRequest::GetRecentBlockhash,
-            ));
-        };
-
-        let blockhash = blockhash.parse().map_err(|_| {
-            ClientError::new_with_request(
-                RpcError::ParseError("Hash".to_string()).into(),
-                RpcRequest::GetRecentBlockhash,
-            )
-        })?;
-        Ok(Response {
-            context,
-            value: (blockhash, fee_calculator, last_valid_slot),
-        })
-    }
-
-    #[deprecated(since = "1.9.0", note = "Please `get_fee_for_message` instead")]
-    #[allow(deprecated)]
-    pub async fn get_fee_calculator_for_blockhash(
-        &self,
-        blockhash: &Hash,
-    ) -> ClientResult<Option<FeeCalculator>> {
-        #[allow(deprecated)]
-        Ok(self
-            .get_fee_calculator_for_blockhash_with_commitment(blockhash, self.commitment())
-            .await?
-            .value)
-    }
-
-    #[deprecated(
-        since = "1.9.0",
-        note = "Please `get_latest_blockhash_with_commitment` and `get_fee_for_message` instead"
-    )]
-    #[allow(deprecated)]
-    pub async fn get_fee_calculator_for_blockhash_with_commitment(
-        &self,
-        blockhash: &Hash,
-        commitment_config: CommitmentConfig,
-    ) -> RpcResult<Option<FeeCalculator>> {
-        let Response { context, value } = self
-            .send::<Response<Option<RpcFeeCalculator>>>(
-                RpcRequest::GetFeeCalculatorForBlockhash,
-                json!([
-                    blockhash.to_string(),
-                    self.maybe_map_commitment(commitment_config).await?
-                ]),
-            )
-            .await?;
-
-        Ok(Response {
-            context,
-            value: value.map(|rf| rf.fee_calculator),
-        })
-    }
-
-    #[deprecated(
-        since = "1.9.0",
-        note = "Please do not use, will no longer be available in the future"
-    )]
-    #[allow(deprecated)]
-    pub async fn get_fee_rate_governor(&self) -> RpcResult<FeeRateGovernor> {
-        let Response {
-            context,
-            value: RpcFeeRateGovernor { fee_rate_governor },
-        } = self
-            .send::<Response<RpcFeeRateGovernor>>(RpcRequest::GetFeeRateGovernor, Value::Null)
-            .await?;
-
-        Ok(Response {
-            context,
-            value: fee_rate_governor,
-        })
-    }
-
-    #[deprecated(
-        since = "1.9.0",
-        note = "Please do not use, will no longer be available in the future"
-    )]
-    #[allow(deprecated)]
-    pub async fn get_new_blockhash(&self, blockhash: &Hash) -> ClientResult<(Hash, FeeCalculator)> {
-        let mut num_retries = 0;
-        let start = Instant::now();
-        while start.elapsed().as_secs() < 5 {
-            #[allow(deprecated)]
-            if let Ok((new_blockhash, fee_calculator)) = self.get_recent_blockhash().await {
-                if new_blockhash != *blockhash {
-                    return Ok((new_blockhash, fee_calculator));
-                }
-            }
-            debug!("Got same blockhash ({:?}), will retry...", blockhash);
-
-            // Retry ~twice during a slot
-            sleep(Duration::from_millis(DEFAULT_MS_PER_SLOT / 2)).await;
-            num_retries += 1;
-        }
-        Err(RpcError::ForUser(format!(
-            "Unable to get new blockhash after {}ms (retried {} times), stuck at {}",
-            start.elapsed().as_millis(),
-            num_retries,
-            blockhash
-        ))
-        .into())
-    }
-
     pub async fn get_first_available_block(&self) -> ClientResult<Slot> {
     pub async fn get_first_available_block(&self) -> ClientResult<Slot> {
         self.send(RpcRequest::GetFirstAvailableBlock, Value::Null)
         self.send(RpcRequest::GetFirstAvailableBlock, Value::Null)
             .await
             .await
@@ -5260,64 +4772,43 @@ impl RpcClient {
         Ok(blockhash)
         Ok(blockhash)
     }
     }
 
 
-    #[allow(deprecated)]
     pub async fn get_latest_blockhash_with_commitment(
     pub async fn get_latest_blockhash_with_commitment(
         &self,
         &self,
         commitment: CommitmentConfig,
         commitment: CommitmentConfig,
     ) -> ClientResult<(Hash, u64)> {
     ) -> ClientResult<(Hash, u64)> {
-        let (blockhash, last_valid_block_height) =
-            if self.get_node_version().await? < semver::Version::new(1, 9, 0) {
-                let Fees {
-                    blockhash,
-                    last_valid_block_height,
-                    ..
-                } = self.get_fees_with_commitment(commitment).await?.value;
-                (blockhash, last_valid_block_height)
-            } else {
-                let RpcBlockhash {
-                    blockhash,
-                    last_valid_block_height,
-                } = self
-                    .send::<Response<RpcBlockhash>>(
-                        RpcRequest::GetLatestBlockhash,
-                        json!([self.maybe_map_commitment(commitment).await?]),
-                    )
-                    .await?
-                    .value;
-                let blockhash = blockhash.parse().map_err(|_| {
-                    ClientError::new_with_request(
-                        RpcError::ParseError("Hash".to_string()).into(),
-                        RpcRequest::GetLatestBlockhash,
-                    )
-                })?;
-                (blockhash, last_valid_block_height)
-            };
+        let RpcBlockhash {
+            blockhash,
+            last_valid_block_height,
+        } = self
+            .send::<Response<RpcBlockhash>>(
+                RpcRequest::GetLatestBlockhash,
+                json!([self.maybe_map_commitment(commitment).await?]),
+            )
+            .await?
+            .value;
+        let blockhash = blockhash.parse().map_err(|_| {
+            ClientError::new_with_request(
+                RpcError::ParseError("Hash".to_string()).into(),
+                RpcRequest::GetLatestBlockhash,
+            )
+        })?;
         Ok((blockhash, last_valid_block_height))
         Ok((blockhash, last_valid_block_height))
     }
     }
 
 
-    #[allow(deprecated)]
     pub async fn is_blockhash_valid(
     pub async fn is_blockhash_valid(
         &self,
         &self,
         blockhash: &Hash,
         blockhash: &Hash,
         commitment: CommitmentConfig,
         commitment: CommitmentConfig,
     ) -> ClientResult<bool> {
     ) -> ClientResult<bool> {
-        let result = if self.get_node_version().await? < semver::Version::new(1, 9, 0) {
-            self.get_fee_calculator_for_blockhash_with_commitment(blockhash, commitment)
-                .await?
-                .value
-                .is_some()
-        } else {
-            self.send::<Response<bool>>(
+        Ok(self
+            .send::<Response<bool>>(
                 RpcRequest::IsBlockhashValid,
                 RpcRequest::IsBlockhashValid,
                 json!([blockhash.to_string(), commitment,]),
                 json!([blockhash.to_string(), commitment,]),
             )
             )
             .await?
             .await?
-            .value
-        };
-        Ok(result)
+            .value)
     }
     }
 
 
-    #[allow(deprecated)]
     pub async fn get_fee_for_message(
     pub async fn get_fee_for_message(
         &self,
         &self,
         message: &impl SerializableMessage,
         message: &impl SerializableMessage,

+ 9 - 293
rpc-client/src/rpc_client.rs

@@ -10,10 +10,6 @@
 //! in [`crate::nonblocking::rpc_client`].
 //! in [`crate::nonblocking::rpc_client`].
 
 
 pub use crate::mock_sender::Mocks;
 pub use crate::mock_sender::Mocks;
-#[allow(deprecated)]
-use solana_rpc_client_api::deprecated_config::{
-    RpcConfirmedBlockConfig, RpcConfirmedTransactionConfig,
-};
 use {
 use {
     crate::{
     crate::{
         http_sender::HttpSender,
         http_sender::HttpSender,
@@ -40,7 +36,6 @@ use {
         epoch_info::EpochInfo,
         epoch_info::EpochInfo,
         epoch_schedule::EpochSchedule,
         epoch_schedule::EpochSchedule,
         feature::Feature,
         feature::Feature,
-        fee_calculator::{FeeCalculator, FeeRateGovernor},
         hash::Hash,
         hash::Hash,
         message::{v0, Message as LegacyMessage},
         message::{v0, Message as LegacyMessage},
         pubkey::Pubkey,
         pubkey::Pubkey,
@@ -1175,15 +1170,6 @@ impl RpcClient {
         self.invoke((self.rpc_client.as_ref()).get_highest_snapshot_slot())
         self.invoke((self.rpc_client.as_ref()).get_highest_snapshot_slot())
     }
     }
 
 
-    #[deprecated(
-        since = "1.8.0",
-        note = "Please use RpcClient::get_highest_snapshot_slot() instead"
-    )]
-    #[allow(deprecated)]
-    pub fn get_snapshot_slot(&self) -> ClientResult<Slot> {
-        self.invoke((self.rpc_client.as_ref()).get_snapshot_slot())
-    }
-
     /// Check if a transaction has been processed with the default [commitment level][cl].
     /// Check if a transaction has been processed with the default [commitment level][cl].
     ///
     ///
     /// [cl]: https://solana.com/docs/rpc#configuring-state-commitment
     /// [cl]: https://solana.com/docs/rpc#configuring-state-commitment
@@ -2122,38 +2108,6 @@ impl RpcClient {
         self.invoke((self.rpc_client.as_ref()).get_block_with_config(slot, config))
         self.invoke((self.rpc_client.as_ref()).get_block_with_config(slot, config))
     }
     }
 
 
-    #[deprecated(since = "1.7.0", note = "Please use RpcClient::get_block() instead")]
-    #[allow(deprecated)]
-    pub fn get_confirmed_block(&self, slot: Slot) -> ClientResult<EncodedConfirmedBlock> {
-        self.invoke((self.rpc_client.as_ref()).get_confirmed_block(slot))
-    }
-
-    #[deprecated(
-        since = "1.7.0",
-        note = "Please use RpcClient::get_block_with_encoding() instead"
-    )]
-    #[allow(deprecated)]
-    pub fn get_confirmed_block_with_encoding(
-        &self,
-        slot: Slot,
-        encoding: UiTransactionEncoding,
-    ) -> ClientResult<EncodedConfirmedBlock> {
-        self.invoke((self.rpc_client.as_ref()).get_confirmed_block_with_encoding(slot, encoding))
-    }
-
-    #[deprecated(
-        since = "1.7.0",
-        note = "Please use RpcClient::get_block_with_config() instead"
-    )]
-    #[allow(deprecated)]
-    pub fn get_confirmed_block_with_config(
-        &self,
-        slot: Slot,
-        config: RpcConfirmedBlockConfig,
-    ) -> ClientResult<UiConfirmedBlock> {
-        self.invoke((self.rpc_client.as_ref()).get_confirmed_block_with_config(slot, config))
-    }
-
     /// Returns a list of finalized blocks between two slots.
     /// Returns a list of finalized blocks between two slots.
     ///
     ///
     /// The range is inclusive, with results including the block for both
     /// The range is inclusive, with results including the block for both
@@ -2178,12 +2132,9 @@ impl RpcClient {
     ///
     ///
     /// # RPC Reference
     /// # RPC Reference
     ///
     ///
-    /// This method corresponds directly to the [`getBlocks`] RPC method, unless
-    /// the remote node version is less than 1.7, in which case it maps to the
-    /// [`getConfirmedBlocks`] RPC method.
+    /// This method corresponds directly to the [`getBlocks`] RPC method.
     ///
     ///
     /// [`getBlocks`]: https://solana.com/docs/rpc/http/getblocks
     /// [`getBlocks`]: https://solana.com/docs/rpc/http/getblocks
-    /// [`getConfirmedBlocks`]: https://solana.com/docs/rpc/deprecated/getconfirmedblocks
     ///
     ///
     /// # Examples
     /// # Examples
     ///
     ///
@@ -2229,12 +2180,9 @@ impl RpcClient {
     ///
     ///
     /// # RPC Reference
     /// # RPC Reference
     ///
     ///
-    /// This method corresponds directly to the [`getBlocks`] RPC method, unless
-    /// the remote node version is less than 1.7, in which case it maps to the
-    /// [`getConfirmedBlocks`] RPC method.
+    /// This method corresponds directly to the [`getBlocks`] RPC method.
     ///
     ///
     /// [`getBlocks`]: https://solana.com/docs/rpc/http/getblocks
     /// [`getBlocks`]: https://solana.com/docs/rpc/http/getblocks
-    /// [`getConfirmedBlocks`]: https://solana.com/docs/rpc/deprecated/getconfirmedblocks
     ///
     ///
     /// # Examples
     /// # Examples
     ///
     ///
@@ -2282,11 +2230,9 @@ impl RpcClient {
     /// # RPC Reference
     /// # RPC Reference
     ///
     ///
     /// This method corresponds directly to the [`getBlocksWithLimit`] RPC
     /// This method corresponds directly to the [`getBlocksWithLimit`] RPC
-    /// method, unless the remote node version is less than 1.7, in which case
-    /// it maps to the [`getConfirmedBlocksWithLimit`] RPC method.
+    /// method.
     ///
     ///
     /// [`getBlocksWithLimit`]: https://solana.com/docs/rpc/http/getblockswithlimit
     /// [`getBlocksWithLimit`]: https://solana.com/docs/rpc/http/getblockswithlimit
-    /// [`getConfirmedBlocksWithLimit`]: https://solana.com/docs/rpc/deprecated/getconfirmedblockswithlimit
     ///
     ///
     /// # Examples
     /// # Examples
     ///
     ///
@@ -2319,11 +2265,9 @@ impl RpcClient {
     /// # RPC Reference
     /// # RPC Reference
     ///
     ///
     /// This method corresponds directly to the [`getBlocksWithLimit`] RPC
     /// This method corresponds directly to the [`getBlocksWithLimit`] RPC
-    /// method, unless the remote node version is less than 1.7, in which case
-    /// it maps to the `getConfirmedBlocksWithLimit` RPC method.
+    /// method.
     ///
     ///
     /// [`getBlocksWithLimit`]: https://solana.com/docs/rpc/http/getblockswithlimit
     /// [`getBlocksWithLimit`]: https://solana.com/docs/rpc/http/getblockswithlimit
-    /// [`getConfirmedBlocksWithLimit`]: https://solana.com/docs/rpc/deprecated/getconfirmedblockswithlimit
     ///
     ///
     /// # Examples
     /// # Examples
     ///
     ///
@@ -2358,69 +2302,6 @@ impl RpcClient {
         )
         )
     }
     }
 
 
-    #[deprecated(since = "1.7.0", note = "Please use RpcClient::get_blocks() instead")]
-    #[allow(deprecated)]
-    pub fn get_confirmed_blocks(
-        &self,
-        start_slot: Slot,
-        end_slot: Option<Slot>,
-    ) -> ClientResult<Vec<Slot>> {
-        self.invoke((self.rpc_client.as_ref()).get_confirmed_blocks(start_slot, end_slot))
-    }
-
-    #[deprecated(
-        since = "1.7.0",
-        note = "Please use RpcClient::get_blocks_with_commitment() instead"
-    )]
-    #[allow(deprecated)]
-    pub fn get_confirmed_blocks_with_commitment(
-        &self,
-        start_slot: Slot,
-        end_slot: Option<Slot>,
-        commitment_config: CommitmentConfig,
-    ) -> ClientResult<Vec<Slot>> {
-        self.invoke(
-            (self.rpc_client.as_ref()).get_confirmed_blocks_with_commitment(
-                start_slot,
-                end_slot,
-                commitment_config,
-            ),
-        )
-    }
-
-    #[deprecated(
-        since = "1.7.0",
-        note = "Please use RpcClient::get_blocks_with_limit() instead"
-    )]
-    #[allow(deprecated)]
-    pub fn get_confirmed_blocks_with_limit(
-        &self,
-        start_slot: Slot,
-        limit: usize,
-    ) -> ClientResult<Vec<Slot>> {
-        self.invoke((self.rpc_client.as_ref()).get_confirmed_blocks_with_limit(start_slot, limit))
-    }
-
-    #[deprecated(
-        since = "1.7.0",
-        note = "Please use RpcClient::get_blocks_with_limit_and_commitment() instead"
-    )]
-    #[allow(deprecated)]
-    pub fn get_confirmed_blocks_with_limit_and_commitment(
-        &self,
-        start_slot: Slot,
-        limit: usize,
-        commitment_config: CommitmentConfig,
-    ) -> ClientResult<Vec<Slot>> {
-        self.invoke(
-            (self.rpc_client.as_ref()).get_confirmed_blocks_with_limit_and_commitment(
-                start_slot,
-                limit,
-                commitment_config,
-            ),
-        )
-    }
-
     /// Get confirmed signatures for transactions involving an address.
     /// Get confirmed signatures for transactions involving an address.
     ///
     ///
     /// Returns up to 1000 signatures, ordered from newest to oldest.
     /// Returns up to 1000 signatures, ordered from newest to oldest.
@@ -2518,34 +2399,6 @@ impl RpcClient {
         )
         )
     }
     }
 
 
-    #[deprecated(
-        since = "1.7.0",
-        note = "Please use RpcClient::get_signatures_for_address() instead"
-    )]
-    #[allow(deprecated)]
-    pub fn get_confirmed_signatures_for_address2(
-        &self,
-        address: &Pubkey,
-    ) -> ClientResult<Vec<RpcConfirmedTransactionStatusWithSignature>> {
-        self.invoke((self.rpc_client.as_ref()).get_confirmed_signatures_for_address2(address))
-    }
-
-    #[deprecated(
-        since = "1.7.0",
-        note = "Please use RpcClient::get_signatures_for_address_with_config() instead"
-    )]
-    #[allow(deprecated)]
-    pub fn get_confirmed_signatures_for_address2_with_config(
-        &self,
-        address: &Pubkey,
-        config: GetConfirmedSignaturesForAddress2Config,
-    ) -> ClientResult<Vec<RpcConfirmedTransactionStatusWithSignature>> {
-        self.invoke(
-            (self.rpc_client.as_ref())
-                .get_confirmed_signatures_for_address2_with_config(address, config),
-        )
-    }
-
     /// Returns transaction details for a confirmed transaction.
     /// Returns transaction details for a confirmed transaction.
     ///
     ///
     /// This method uses the [`Finalized`] [commitment level][cl].
     /// This method uses the [`Finalized`] [commitment level][cl].
@@ -2555,12 +2408,9 @@ impl RpcClient {
     ///
     ///
     /// # RPC Reference
     /// # RPC Reference
     ///
     ///
-    /// This method corresponds directly to the [`getTransaction`] RPC method,
-    /// unless the remote node version is less than 1.7, in which case it maps
-    /// to the [`getConfirmedTransaction`] RPC method.
+    /// This method corresponds directly to the [`getTransaction`] RPC method.
     ///
     ///
     /// [`getTransaction`]: https://solana.com/docs/rpc/http/gettransaction
     /// [`getTransaction`]: https://solana.com/docs/rpc/http/gettransaction
-    /// [`getConfirmedTransaction`]: https://solana.com/docs/rpc/deprecated/getConfirmedTransaction
     ///
     ///
     /// # Examples
     /// # Examples
     ///
     ///
@@ -2607,12 +2457,9 @@ impl RpcClient {
     ///
     ///
     /// # RPC Reference
     /// # RPC Reference
     ///
     ///
-    /// This method corresponds directly to the [`getTransaction`] RPC method,
-    /// unless the remote node version is less than 1.7, in which case it maps
-    /// to the [`getConfirmedTransaction`] RPC method.
+    /// This method corresponds directly to the [`getTransaction`] RPC method.
     ///
     ///
     /// [`getTransaction`]: https://solana.com/docs/rpc/http/gettransaction
     /// [`getTransaction`]: https://solana.com/docs/rpc/http/gettransaction
-    /// [`getConfirmedTransaction`]: https://solana.com/docs/rpc/deprecated/getConfirmedTransaction
     ///
     ///
     /// # Examples
     /// # Examples
     ///
     ///
@@ -2656,34 +2503,6 @@ impl RpcClient {
         self.invoke((self.rpc_client.as_ref()).get_transaction_with_config(signature, config))
         self.invoke((self.rpc_client.as_ref()).get_transaction_with_config(signature, config))
     }
     }
 
 
-    #[deprecated(
-        since = "1.7.0",
-        note = "Please use RpcClient::get_transaction() instead"
-    )]
-    #[allow(deprecated)]
-    pub fn get_confirmed_transaction(
-        &self,
-        signature: &Signature,
-        encoding: UiTransactionEncoding,
-    ) -> ClientResult<EncodedConfirmedTransactionWithStatusMeta> {
-        self.invoke((self.rpc_client.as_ref()).get_confirmed_transaction(signature, encoding))
-    }
-
-    #[deprecated(
-        since = "1.7.0",
-        note = "Please use RpcClient::get_transaction_with_config() instead"
-    )]
-    #[allow(deprecated)]
-    pub fn get_confirmed_transaction_with_config(
-        &self,
-        signature: &Signature,
-        config: RpcConfirmedTransactionConfig,
-    ) -> ClientResult<EncodedConfirmedTransactionWithStatusMeta> {
-        self.invoke(
-            (self.rpc_client.as_ref()).get_confirmed_transaction_with_config(signature, config),
-        )
-    }
-
     /// Returns the estimated production time of a block.
     /// Returns the estimated production time of a block.
     ///
     ///
     /// # RPC Reference
     /// # RPC Reference
@@ -3697,87 +3516,6 @@ impl RpcClient {
         )
         )
     }
     }
 
 
-    #[deprecated(
-        since = "1.9.0",
-        note = "Please use `get_latest_blockhash` and `get_fee_for_message` instead"
-    )]
-    #[allow(deprecated)]
-    pub fn get_fees(&self) -> ClientResult<Fees> {
-        self.invoke((self.rpc_client.as_ref()).get_fees())
-    }
-
-    #[deprecated(
-        since = "1.9.0",
-        note = "Please use `get_latest_blockhash_with_commitment` and `get_fee_for_message` instead"
-    )]
-    #[allow(deprecated)]
-    pub fn get_fees_with_commitment(&self, commitment_config: CommitmentConfig) -> RpcResult<Fees> {
-        self.invoke((self.rpc_client.as_ref()).get_fees_with_commitment(commitment_config))
-    }
-
-    #[deprecated(since = "1.9.0", note = "Please use `get_latest_blockhash` instead")]
-    #[allow(deprecated)]
-    pub fn get_recent_blockhash(&self) -> ClientResult<(Hash, FeeCalculator)> {
-        self.invoke((self.rpc_client.as_ref()).get_recent_blockhash())
-    }
-
-    #[deprecated(
-        since = "1.9.0",
-        note = "Please use `get_latest_blockhash_with_commitment` instead"
-    )]
-    #[allow(deprecated)]
-    pub fn get_recent_blockhash_with_commitment(
-        &self,
-        commitment_config: CommitmentConfig,
-    ) -> RpcResult<(Hash, FeeCalculator, Slot)> {
-        self.invoke(
-            (self.rpc_client.as_ref()).get_recent_blockhash_with_commitment(commitment_config),
-        )
-    }
-
-    #[deprecated(since = "1.9.0", note = "Please `get_fee_for_message` instead")]
-    #[allow(deprecated)]
-    pub fn get_fee_calculator_for_blockhash(
-        &self,
-        blockhash: &Hash,
-    ) -> ClientResult<Option<FeeCalculator>> {
-        self.invoke((self.rpc_client.as_ref()).get_fee_calculator_for_blockhash(blockhash))
-    }
-
-    #[deprecated(
-        since = "1.9.0",
-        note = "Please `get_latest_blockhash_with_commitment` and `get_fee_for_message` instead"
-    )]
-    #[allow(deprecated)]
-    pub fn get_fee_calculator_for_blockhash_with_commitment(
-        &self,
-        blockhash: &Hash,
-        commitment_config: CommitmentConfig,
-    ) -> RpcResult<Option<FeeCalculator>> {
-        self.invoke(
-            (self.rpc_client.as_ref())
-                .get_fee_calculator_for_blockhash_with_commitment(blockhash, commitment_config),
-        )
-    }
-
-    #[deprecated(
-        since = "1.9.0",
-        note = "Please do not use, will no longer be available in the future"
-    )]
-    #[allow(deprecated)]
-    pub fn get_fee_rate_governor(&self) -> RpcResult<FeeRateGovernor> {
-        self.invoke((self.rpc_client.as_ref()).get_fee_rate_governor())
-    }
-
-    #[deprecated(
-        since = "1.9.0",
-        note = "Please do not use, will no longer be available in the future"
-    )]
-    #[allow(deprecated)]
-    pub fn get_new_blockhash(&self, blockhash: &Hash) -> ClientResult<(Hash, FeeCalculator)> {
-        self.invoke((self.rpc_client.as_ref()).get_new_blockhash(blockhash))
-    }
-
     pub fn get_first_available_block(&self) -> ClientResult<Slot> {
     pub fn get_first_available_block(&self) -> ClientResult<Slot> {
         self.invoke((self.rpc_client.as_ref()).get_first_available_block())
         self.invoke((self.rpc_client.as_ref()).get_first_available_block())
     }
     }
@@ -3996,7 +3734,6 @@ impl RpcClient {
         self.invoke((self.rpc_client.as_ref()).get_latest_blockhash())
         self.invoke((self.rpc_client.as_ref()).get_latest_blockhash())
     }
     }
 
 
-    #[allow(deprecated)]
     pub fn get_latest_blockhash_with_commitment(
     pub fn get_latest_blockhash_with_commitment(
         &self,
         &self,
         commitment: CommitmentConfig,
         commitment: CommitmentConfig,
@@ -4004,7 +3741,6 @@ impl RpcClient {
         self.invoke((self.rpc_client.as_ref()).get_latest_blockhash_with_commitment(commitment))
         self.invoke((self.rpc_client.as_ref()).get_latest_blockhash_with_commitment(commitment))
     }
     }
 
 
-    #[allow(deprecated)]
     pub fn is_blockhash_valid(
     pub fn is_blockhash_valid(
         &self,
         &self,
         blockhash: &Hash,
         blockhash: &Hash,
@@ -4013,7 +3749,6 @@ impl RpcClient {
         self.invoke((self.rpc_client.as_ref()).is_blockhash_valid(blockhash, commitment))
         self.invoke((self.rpc_client.as_ref()).is_blockhash_valid(blockhash, commitment))
     }
     }
 
 
-    #[allow(deprecated)]
     pub fn get_fee_for_message(&self, message: &impl SerializableMessage) -> ClientResult<u64> {
     pub fn get_fee_for_message(&self, message: &impl SerializableMessage) -> ClientResult<u64> {
         self.invoke((self.rpc_client.as_ref()).get_fee_for_message(message))
         self.invoke((self.rpc_client.as_ref()).get_fee_for_message(message))
     }
     }
@@ -4137,7 +3872,7 @@ mod tests {
                 future::ok(Value::Number(Number::from(50)))
                 future::ok(Value::Number(Number::from(50)))
             });
             });
             // Failed request
             // Failed request
-            io.add_method("getRecentBlockhash", |params: Params| {
+            io.add_method("getLatestBlockhash", |params: Params| {
                 if params != Params::None {
                 if params != Params::None {
                     future::err(Error::invalid_request())
                     future::err(Error::invalid_request())
                 } else {
                 } else {
@@ -4169,16 +3904,14 @@ mod tests {
             .unwrap();
             .unwrap();
         assert_eq!(balance, 50);
         assert_eq!(balance, 50);
 
 
-        #[allow(deprecated)]
         let blockhash: String = rpc_client
         let blockhash: String = rpc_client
-            .send(RpcRequest::GetRecentBlockhash, Value::Null)
+            .send(RpcRequest::GetLatestBlockhash, Value::Null)
             .unwrap();
             .unwrap();
         assert_eq!(blockhash, "deadbeefXjn8o3yroDHxUtKsZZgoy4GPkPPXfouKNHhx");
         assert_eq!(blockhash, "deadbeefXjn8o3yroDHxUtKsZZgoy4GPkPPXfouKNHhx");
 
 
         // Send erroneous parameter
         // Send erroneous parameter
-        #[allow(deprecated)]
         let blockhash: ClientResult<String> =
         let blockhash: ClientResult<String> =
-            rpc_client.send(RpcRequest::GetRecentBlockhash, json!(["parameter"]));
+            rpc_client.send(RpcRequest::GetLatestBlockhash, json!(["parameter"]));
         assert!(blockhash.is_err());
         assert!(blockhash.is_err());
     }
     }
 
 
@@ -4205,22 +3938,6 @@ mod tests {
         assert!(signature.is_err());
         assert!(signature.is_err());
     }
     }
 
 
-    #[test]
-    fn test_get_recent_blockhash() {
-        let rpc_client = RpcClient::new_mock("succeeds".to_string());
-
-        let expected_blockhash: Hash = PUBKEY.parse().unwrap();
-
-        let blockhash = rpc_client.get_latest_blockhash().expect("blockhash ok");
-        assert_eq!(blockhash, expected_blockhash);
-
-        let rpc_client = RpcClient::new_mock("fails".to_string());
-
-        #[allow(deprecated)]
-        let result = rpc_client.get_recent_blockhash();
-        assert!(result.is_err());
-    }
-
     #[test]
     #[test]
     fn test_custom_request() {
     fn test_custom_request() {
         let rpc_client = RpcClient::new_mock("succeeds".to_string());
         let rpc_client = RpcClient::new_mock("succeeds".to_string());
@@ -4320,7 +4037,6 @@ mod tests {
 
 
         let rpc_client = RpcClient::new_mock("fails".to_string());
         let rpc_client = RpcClient::new_mock("fails".to_string());
 
 
-        #[allow(deprecated)]
         let is_err = rpc_client.get_latest_blockhash().is_err();
         let is_err = rpc_client.get_latest_blockhash().is_err();
         assert!(is_err);
         assert!(is_err);
     }
     }

+ 1 - 16
test-validator/src/lib.rs

@@ -44,8 +44,7 @@ use {
         epoch_schedule::EpochSchedule,
         epoch_schedule::EpochSchedule,
         exit::Exit,
         exit::Exit,
         feature_set::FEATURE_NAMES,
         feature_set::FEATURE_NAMES,
-        fee_calculator::{FeeCalculator, FeeRateGovernor},
-        hash::Hash,
+        fee_calculator::FeeRateGovernor,
         instruction::{AccountMeta, Instruction},
         instruction::{AccountMeta, Instruction},
         message::Message,
         message::Message,
         native_token::sol_to_lamports,
         native_token::sol_to_lamports,
@@ -1163,20 +1162,6 @@ impl TestValidator {
         self.vote_account_address
         self.vote_account_address
     }
     }
 
 
-    /// Return an RpcClient for the validator.  As a convenience, also return a recent blockhash and
-    /// associated fee calculator
-    #[deprecated(since = "1.9.0", note = "Please use `get_rpc_client` instead")]
-    pub fn rpc_client(&self) -> (RpcClient, Hash, FeeCalculator) {
-        let rpc_client =
-            RpcClient::new_with_commitment(self.rpc_url.clone(), CommitmentConfig::processed());
-        #[allow(deprecated)]
-        let (recent_blockhash, fee_calculator) = rpc_client
-            .get_recent_blockhash()
-            .expect("get_recent_blockhash");
-
-        (rpc_client, recent_blockhash, fee_calculator)
-    }
-
     /// Return an RpcClient for the validator.
     /// Return an RpcClient for the validator.
     pub fn get_rpc_client(&self) -> RpcClient {
     pub fn get_rpc_client(&self) -> RpcClient {
         RpcClient::new_with_commitment(self.rpc_url.clone(), CommitmentConfig::processed())
         RpcClient::new_with_commitment(self.rpc_url.clone(), CommitmentConfig::processed())