Skip to content

Commit 4e473eb

Browse files
feat: add get_current_step getter (#2034)
* feat: add get_current_step getter Signed-off-by: Dori Medini <[email protected]> * chore: changelog Signed-off-by: Dori Medini <[email protected]> * test: add coverage Signed-off-by: Dori Medini <[email protected]> --------- Signed-off-by: Dori Medini <[email protected]>
1 parent 7b9e1c5 commit 4e473eb

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+
* feat: add get_current_step getter [#2034](https://github.com/lambdaclass/cairo-vm/pull/2034)
6+
57
* feat: implement VirtualMachine::is_accessed [#2033](https://github.com/lambdaclass/cairo-vm/pull/2033)
68

79
* Refactor: Replaced HashMap with BTreeMap to guarantee deterministic ordering of the data [#2023] (https://github.com/lambdaclass/cairo-vm/pull/2023)

vm/src/vm/vm_core.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,10 @@ impl VirtualMachine {
895895
self.run_context.get_pc()
896896
}
897897

898+
pub fn get_current_step(&self) -> usize {
899+
self.current_step
900+
}
901+
898902
///Gets the integer value corresponding to the Relocatable address
899903
pub fn get_integer(&self, key: Relocatable) -> Result<Cow<Felt252>, MemoryError> {
900904
self.segments.memory.get_integer(key)
@@ -5170,7 +5174,7 @@ mod tests {
51705174
let mut virtual_machine_from_builder = virtual_machine_builder.build();
51715175

51725176
assert!(virtual_machine_from_builder.run_finished);
5173-
assert_eq!(virtual_machine_from_builder.current_step, 12);
5177+
assert_eq!(virtual_machine_from_builder.get_current_step(), 12);
51745178
assert_eq!(
51755179
virtual_machine_from_builder
51765180
.builtin_runners

0 commit comments

Comments
 (0)