Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.0: Remove assorted deprecated symbols (backport of #1995) #2002

Merged
merged 2 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 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 @@ -55,7 +49,7 @@ use {
solana_measure::measure::Measure,
solana_net_utils::{
bind_common, bind_common_in_range, bind_in_range, bind_two_in_range_with_offset,
find_available_port_in_range, multi_bind_in_range, PortRange,
find_available_port_in_range, multi_bind_in_range, PortRange, 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