Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
constructing with default
Browse files Browse the repository at this point in the history
  • Loading branch information
tao-stones committed Oct 9, 2023
1 parent a2ae22f commit 0c10518
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions program-runtime/src/compute_budget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,11 @@ impl ComputeBudget {
feature_set: &FeatureSet,
) -> Result<Self> {
let compute_budget_limits = process_compute_budget_instructions(instructions, feature_set)?;
let mut compute_budget =
ComputeBudget::new(u64::from(compute_budget_limits.compute_unit_limit));
compute_budget.heap_size = compute_budget_limits.updated_heap_bytes;
Ok(compute_budget)
Ok(ComputeBudget {
compute_unit_limit: u64::from(compute_budget_limits.compute_unit_limit),
heap_size: compute_budget_limits.updated_heap_bytes,
..ComputeBudget::default()
})
}

/// Returns cost of the Poseidon hash function for the given number of
Expand Down

0 comments on commit 0c10518

Please sign in to comment.