deprecate fees sysvar (#18960)

This commit is contained in:
Jack May
2021-07-29 10:48:14 -07:00
committed by GitHub
parent da480bdb5f
commit dfbb0c559b
11 changed files with 98 additions and 88 deletions

View File

@ -1,6 +1,8 @@
//! The solana-program-test provides a BanksClient-based test framework BPF programs
#![allow(clippy::integer_arithmetic)]
#[allow(deprecated)]
use solana_sdk::sysvar::fees::Fees;
use {
async_trait::async_trait,
chrono_humanize::{Accuracy, HumanTime, Tense},
@ -34,7 +36,7 @@ use {
signature::{Keypair, Signer},
sysvar::{
clock, epoch_schedule,
fees::{self, Fees},
fees::{self},
rent, Sysvar,
},
},
@ -377,6 +379,7 @@ impl solana_sdk::program_stubs::SyscallStubs for SyscallStubs {
get_sysvar::<EpochSchedule>(&epoch_schedule::id(), var_addr)
}
#[allow(deprecated)]
fn sol_get_fees_sysvar(&self, var_addr: *mut u8) -> u64 {
get_sysvar::<Fees>(&fees::id(), var_addr)
}

View File

@ -1,17 +1,11 @@
#[allow(deprecated)]
use solana_sdk::sysvar::fees::Fees;
use {
solana_program_test::{processor, ProgramTest},
solana_sdk::{
account_info::AccountInfo,
clock::Clock,
entrypoint::ProgramResult,
epoch_schedule::EpochSchedule,
fee_calculator::FeeCalculator,
instruction::Instruction,
msg,
pubkey::Pubkey,
rent::Rent,
signature::Signer,
sysvar::{fees::Fees, Sysvar},
account_info::AccountInfo, clock::Clock, entrypoint::ProgramResult,
epoch_schedule::EpochSchedule, fee_calculator::FeeCalculator, instruction::Instruction,
msg, pubkey::Pubkey, rent::Rent, signature::Signer, sysvar::Sysvar,
transaction::Transaction,
},
};
@ -30,13 +24,16 @@ fn sysvar_getter_process_instruction(
let epoch_schedule = EpochSchedule::get()?;
assert_eq!(epoch_schedule, EpochSchedule::default());
let fees = Fees::get()?;
assert_eq!(
fees.fee_calculator,
FeeCalculator {
lamports_per_signature: 5000
}
);
#[allow(deprecated)]
{
let fees = Fees::get()?;
assert_eq!(
fees.fee_calculator,
FeeCalculator {
lamports_per_signature: 5000
}
);
}
let rent = Rent::get()?;
assert_eq!(rent, Rent::default());