Skip to content

Commit

Permalink
Remove test case passing fees sysvar as account
Browse files Browse the repository at this point in the history
  • Loading branch information
CriesofCarrots committed Jul 8, 2024
1 parent 90b056c commit 2754b5a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
13 changes: 1 addition & 12 deletions programs/sbf/rust/sysvar/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ pub fn process_instruction(
AccountMeta::new_readonly(*accounts[8].key, false),
AccountMeta::new_readonly(*accounts[9].key, false),
AccountMeta::new_readonly(*accounts[10].key, false),
AccountMeta::new_readonly(*accounts[11].key, false),
],
)
);
Expand Down Expand Up @@ -114,21 +113,11 @@ pub fn process_instruction(
sysvar::stake_history::id().log();
let _ = StakeHistory::from_account_info(&accounts[9]).unwrap();

// Fees
#[allow(deprecated)]
if instruction_data[0] == 1 {
msg!("Fee identifier:");
sysvar::fees::id().log();
let fees = Fees::from_account_info(&accounts[10]).unwrap();
let got_fees = Fees::get().unwrap();
assert_eq!(fees, got_fees);
}

// Epoch Rewards
{
msg!("EpochRewards identifier:");
sysvar::epoch_rewards::id().log();
let epoch_rewards = EpochRewards::from_account_info(&accounts[11]).unwrap();
let epoch_rewards = EpochRewards::from_account_info(&accounts[10]).unwrap();
let got_epoch_rewards = EpochRewards::get().unwrap();
assert_eq!(epoch_rewards, got_epoch_rewards);
}
Expand Down
4 changes: 1 addition & 3 deletions programs/sbf/tests/sysvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use {
pubkey::Pubkey,
signature::{Keypair, Signer},
sysvar::{
clock, epoch_rewards, epoch_schedule, fees, instructions, recent_blockhashes, rent,
clock, epoch_rewards, epoch_schedule, instructions, recent_blockhashes, rent,
slot_hashes, slot_history, stake_history,
},
transaction::{SanitizedTransaction, Transaction},
Expand Down Expand Up @@ -67,8 +67,6 @@ fn test_sysvar_syscalls() {
AccountMeta::new_readonly(slot_hashes::id(), false),
AccountMeta::new_readonly(slot_history::id(), false),
AccountMeta::new_readonly(stake_history::id(), false),
#[allow(deprecated)]
AccountMeta::new_readonly(fees::id(), false),
AccountMeta::new_readonly(epoch_rewards::id(), false),
],
);
Expand Down

0 comments on commit 2754b5a

Please sign in to comment.