From efdbdc00cea2b89338b2e8e1f9ebb6ca77c8b5fa Mon Sep 17 00:00:00 2001 From: Tyera Date: Wed, 3 Jul 2024 14:07:35 -0600 Subject: [PATCH] Remove assorted deprecated symbols (#1995) * Remove deprecated method from program-test * Remove deprecated programs stuff from TestValidator * Remove deprecated method from TestValidator (deprecated in v1.11.0) * Remove deprecated re-export from cluster_info --- gossip/src/cluster_info.rs | 7 +----- program-test/src/lib.rs | 7 ------ test-validator/src/lib.rs | 44 -------------------------------------- 3 files changed, 1 insertion(+), 57 deletions(-) diff --git a/gossip/src/cluster_info.rs b/gossip/src/cluster_info.rs index 57a1e95babc5a5..57d1a01231493f 100644 --- a/gossip/src/cluster_info.rs +++ b/gossip/src/cluster_info.rs @@ -13,12 +13,6 @@ //! //! Bank needs to provide an interface for us to query the stake weight -#[deprecated( - since = "1.10.6", - note = "Please use `solana_net_utils::{MINIMUM_VALIDATOR_PORT_RANGE_WIDTH, VALIDATOR_PORT_RANGE}` instead" -)] -#[allow(deprecated)] -pub use solana_net_utils::{MINIMUM_VALIDATOR_PORT_RANGE_WIDTH, VALIDATOR_PORT_RANGE}; use { crate::{ cluster_info_metrics::{ @@ -57,6 +51,7 @@ use { bind_common, bind_common_in_range, bind_in_range, bind_in_range_with_config, bind_more_with_config, bind_two_in_range_with_offset_and_config, find_available_port_in_range, multi_bind_in_range, PortRange, SocketConfig, + VALIDATOR_PORT_RANGE, }, solana_perf::{ data_budget::DataBudget, diff --git a/program-test/src/lib.rs b/program-test/src/lib.rs index f3c06d6b0fe94b..ab44ae53ea66b6 100644 --- a/program-test/src/lib.rs +++ b/program-test/src/lib.rs @@ -545,13 +545,6 @@ impl ProgramTest { self.transaction_account_lock_limit = Some(transaction_account_lock_limit); } - /// Override the SBF compute budget - #[allow(deprecated)] - #[deprecated(since = "1.8.0", note = "please use `set_compute_max_units` instead")] - pub fn set_bpf_compute_max_units(&mut self, bpf_compute_max_units: u64) { - self.set_compute_max_units(bpf_compute_max_units); - } - /// Add an account to the test environment's genesis config. pub fn add_genesis_account(&mut self, address: Pubkey, account: Account) { self.genesis_accounts diff --git a/test-validator/src/lib.rs b/test-validator/src/lib.rs index 8c6fd289018113..da0d669b76393a 100644 --- a/test-validator/src/lib.rs +++ b/test-validator/src/lib.rs @@ -77,14 +77,6 @@ pub struct AccountInfo<'a> { pub filename: &'a str, } -#[deprecated(since = "1.16.0", note = "Please use `UpgradeableProgramInfo` instead")] -#[derive(Clone)] -pub struct ProgramInfo { - pub program_id: Pubkey, - pub loader: Pubkey, - pub program_path: PathBuf, -} - #[derive(Clone)] pub struct UpgradeableProgramInfo { pub program_id: Pubkey, @@ -126,8 +118,6 @@ pub struct TestValidatorGenesis { rpc_ports: Option<(u16, u16)>, // (JsonRpc, JsonRpcPubSub), None == random ports warp_slot: Option, accounts: HashMap, - #[allow(deprecated)] - programs: Vec, upgradeable_programs: Vec, ticks_per_slot: Option, epoch_schedule: Option, @@ -160,8 +150,6 @@ impl Default for TestValidatorGenesis { rpc_ports: Option::<(u16, u16)>::default(), warp_slot: Option::::default(), accounts: HashMap::::default(), - #[allow(deprecated)] - programs: Vec::::default(), upgradeable_programs: Vec::::default(), ticks_per_slot: Option::::default(), epoch_schedule: Option::::default(), @@ -319,11 +307,6 @@ impl TestValidatorGenesis { self } - #[deprecated(note = "Please use `compute_unit_limit` instead")] - pub fn max_compute_units(&mut self, max_compute_units: u64) -> &mut Self { - self.compute_unit_limit(max_compute_units) - } - /// Add an account to the test environment pub fn add_account(&mut self, address: Pubkey, account: AccountSharedData) -> &mut Self { self.accounts.insert(address, account); @@ -581,19 +564,6 @@ impl TestValidatorGenesis { self } - /// Add a list of programs to the test environment. - #[deprecated( - since = "1.16.0", - note = "Please use `add_upgradeable_programs_with_path()` instead" - )] - #[allow(deprecated)] - pub fn add_programs_with_path(&mut self, programs: &[ProgramInfo]) -> &mut Self { - for program in programs { - self.programs.push(program.clone()); - } - self - } - /// Add a list of upgradeable programs to the test environment. pub fn add_upgradeable_programs_with_path( &mut self, @@ -795,20 +765,6 @@ impl TestValidator { for (address, account) in solana_program_test::programs::spl_programs(&config.rent) { accounts.entry(address).or_insert(account); } - #[allow(deprecated)] - for program in &config.programs { - let data = solana_program_test::read_file(&program.program_path); - accounts.insert( - program.program_id, - AccountSharedData::from(Account { - lamports: Rent::default().minimum_balance(data.len()).max(1), - data, - owner: program.loader, - executable: true, - rent_epoch: 0, - }), - ); - } for upgradeable_program in &config.upgradeable_programs { let data = solana_program_test::read_file(&upgradeable_program.program_path); let (programdata_address, _) = Pubkey::find_program_address(