Skip to content

Commit ea4328c

Browse files
committed
Change signature of compute_and_store_execution_summary
1 parent 206083a commit ea4328c

File tree

2 files changed

+11
-6
lines changed
  • crates/cheatnet/src

2 files changed

+11
-6
lines changed

crates/cheatnet/src/runtime_extensions/forge_runtime_extension/mod.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -742,14 +742,22 @@ pub fn update_top_call_vm_trace(runtime: &mut ForgeRuntime, cairo_runner: &mut C
742742
}
743743
}
744744

745-
pub fn compute_and_store_execution_summary(trace: &Rc<RefCell<CallTrace>>) -> ExecutionSummary {
745+
pub fn compute_and_store_execution_summary(trace: &Rc<RefCell<CallTrace>>) {
746746
let execution_summary = if trace.borrow().nested_calls.is_empty() {
747747
get_call_execution_summary(trace)
748748
} else {
749749
let mut nested_calls_summaries = vec![];
750750
for nested_call in &trace.borrow().nested_calls {
751751
if let CallTraceNode::EntryPointCall(nested_call) = nested_call {
752-
nested_calls_summaries.push(compute_and_store_execution_summary(nested_call));
752+
compute_and_store_execution_summary(nested_call);
753+
nested_calls_summaries.push(
754+
nested_call
755+
.borrow()
756+
.gas_report_data
757+
.as_ref()
758+
.expect("Gas report data must be set after calling `compute_and_store_execution_summary`")
759+
.execution_summary
760+
.clone());
753761
}
754762
}
755763
let mut current_call_summary =
@@ -764,8 +772,6 @@ pub fn compute_and_store_execution_summary(trace: &Rc<RefCell<CallTrace>>) -> Ex
764772
};
765773

766774
trace.borrow_mut().gas_report_data = Some(GasReportData::new(execution_summary.clone()));
767-
768-
execution_summary
769775
}
770776

771777
// Based on blockifier/src/execution/call_info.rs (summarize)

crates/cheatnet/src/state.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,7 @@ impl<T> CheatStatus<T> {
205205

206206
#[derive(Debug)]
207207
pub struct GasReportData {
208-
#[expect(dead_code)]
209-
execution_summary: ExecutionSummary,
208+
pub execution_summary: ExecutionSummary,
210209
}
211210

212211
impl GasReportData {

0 commit comments

Comments
 (0)