Skip to content

Commit

Permalink
allow instruction to override sysvars
Browse files Browse the repository at this point in the history
  • Loading branch information
2501babe committed Dec 6, 2024
1 parent 56820ab commit 298fce3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions harness/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ impl Mollusk {
let mut compute_units_consumed = 0;
let mut timings = ExecuteTimings::default();

let mut sysvars = self.sysvars.clone();
sysvars.fill_from_accounts(&accounts);

let loader_key = self
.program_cache
.load_program(&instruction.program_id)
Expand All @@ -169,7 +172,7 @@ impl Mollusk {

let mut transaction_context = TransactionContext::new(
transaction_accounts,
self.sysvars.rent.clone(),
sysvars.rent.clone(),
self.compute_budget.max_instruction_stack_depth,
self.compute_budget.max_instruction_trace_length,
);
Expand All @@ -185,7 +188,7 @@ impl Mollusk {
None,
Arc::new(self.feature_set.clone()),
self.fee_structure.lamports_per_signature,
&SysvarCache::from(&self.sysvars),
&SysvarCache::from(&sysvars),
),
None,
self.compute_budget,
Expand Down

0 comments on commit 298fce3

Please sign in to comment.