diff --git a/CHANGELOG.md b/CHANGELOG.md index d8d7ff542b..dc7bc09220 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ #### Upcoming Changes +* Add `RunResources::get_n_steps` method [#1225](https://github.com/lambdaclass/cairo-rs/pull/1225) + * fix: pin Cairo compiler version [#1220](https://github.com/lambdaclass/cairo-rs/pull/1220) * perf: make `inner_rc_bound` a constant, improving performance of the range-check builtin diff --git a/src/vm/runners/cairo_runner.rs b/src/vm/runners/cairo_runner.rs index 3494347188..d108674278 100644 --- a/src/vm/runners/cairo_runner.rs +++ b/src/vm/runners/cairo_runner.rs @@ -94,6 +94,10 @@ impl RunResources { pub fn consume_steps(&mut self) { self.n_steps -= 1; } + + pub fn get_n_steps(&self) -> usize { + self.n_steps + } } #[derive(Debug)] @@ -4978,7 +4982,7 @@ mod tests { Ok(()) ); - assert_eq!(run_resources, Some(RunResources::new(1))); + assert_eq!(run_resources.unwrap().get_n_steps(), 1); } #[test]