Skip to content

Commit

Permalink
fix more test
Browse files Browse the repository at this point in the history
  • Loading branch information
pgarg66 committed Mar 6, 2024
1 parent 9044bb8 commit 5f4e004
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions program-runtime/src/invoke_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -638,8 +638,12 @@ macro_rules! with_mock_invoke_context {
) => {
use {
solana_sdk::{
account::ReadableAccount, epoch_schedule::EpochSchedule, feature_set::FeatureSet,
hash::Hash, sysvar::rent::Rent, transaction_context::TransactionContext,
account::ReadableAccount,
epoch_schedule::EpochSchedule,
feature_set::FeatureSet,
hash::Hash,
sysvar::{epoch_schedule, rent::Rent},
transaction_context::TransactionContext,
},
std::sync::Arc,
$crate::{
Expand All @@ -648,6 +652,9 @@ macro_rules! with_mock_invoke_context {
sysvar_cache::SysvarCache,
},
};
let set_epoch_schedule = !$transaction_accounts
.iter()
.any(|(pubkey, _)| *pubkey == epoch_schedule::id());
let compute_budget = ComputeBudget::default();
let mut $transaction_context = TransactionContext::new(
$transaction_accounts,
Expand All @@ -673,7 +680,9 @@ macro_rules! with_mock_invoke_context {
}
}
});
sysvar_cache.set_epoch_schedule(EpochSchedule::default());
if set_epoch_schedule {
sysvar_cache.set_epoch_schedule(EpochSchedule::default());
}
let programs_loaded_for_tx_batch = LoadedProgramsForTxBatch::default();
let mut programs_modified_by_tx = LoadedProgramsForTxBatch::default();
let mut $invoke_context = InvokeContext::new(
Expand Down

0 comments on commit 5f4e004

Please sign in to comment.