Skip to content

Commit 290769d

Browse files
authored
Add RunResources.get_n_steps method (#1225)
* Add RunResources.get_n_steps method * Update CHANGELOG.md * use no mut reference
1 parent 73539d3 commit 290769d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#### Upcoming Changes
44

5+
* Add `RunResources::get_n_steps` method [#1225](https://github.com/lambdaclass/cairo-rs/pull/1225)
6+
57
* fix: pin Cairo compiler version [#1220](https://github.com/lambdaclass/cairo-rs/pull/1220)
68

79
* perf: make `inner_rc_bound` a constant, improving performance of the range-check builtin

src/vm/runners/cairo_runner.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ impl RunResources {
9494
pub fn consume_steps(&mut self) {
9595
self.n_steps -= 1;
9696
}
97+
98+
pub fn get_n_steps(&self) -> usize {
99+
self.n_steps
100+
}
97101
}
98102

99103
#[derive(Debug)]
@@ -4978,7 +4982,7 @@ mod tests {
49784982
Ok(())
49794983
);
49804984

4981-
assert_eq!(run_resources, Some(RunResources::new(1)));
4985+
assert_eq!(run_resources.unwrap().get_n_steps(), 1);
49824986
}
49834987

49844988
#[test]

0 commit comments

Comments
 (0)