Skip to content

Commit

Permalink
Remove assorted deprecated symbols (anza-xyz#1995)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
CriesofCarrots authored Jul 3, 2024
1 parent 1063be7 commit efdbdc0
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 57 deletions.
7 changes: 1 addition & 6 deletions gossip/src/cluster_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down Expand Up @@ -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,
Expand Down
7 changes: 0 additions & 7 deletions program-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
44 changes: 0 additions & 44 deletions test-validator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -126,8 +118,6 @@ pub struct TestValidatorGenesis {
rpc_ports: Option<(u16, u16)>, // (JsonRpc, JsonRpcPubSub), None == random ports
warp_slot: Option<Slot>,
accounts: HashMap<Pubkey, AccountSharedData>,
#[allow(deprecated)]
programs: Vec<ProgramInfo>,
upgradeable_programs: Vec<UpgradeableProgramInfo>,
ticks_per_slot: Option<u64>,
epoch_schedule: Option<EpochSchedule>,
Expand Down Expand Up @@ -160,8 +150,6 @@ impl Default for TestValidatorGenesis {
rpc_ports: Option::<(u16, u16)>::default(),
warp_slot: Option::<Slot>::default(),
accounts: HashMap::<Pubkey, AccountSharedData>::default(),
#[allow(deprecated)]
programs: Vec::<ProgramInfo>::default(),
upgradeable_programs: Vec::<UpgradeableProgramInfo>::default(),
ticks_per_slot: Option::<u64>::default(),
epoch_schedule: Option::<EpochSchedule>::default(),
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit efdbdc0

Please sign in to comment.