Skip to content

Commit

Permalink
Merge branch 'main' into perf/eager_memory_resize_load_data
Browse files Browse the repository at this point in the history
  • Loading branch information
Oppen committed May 5, 2023
2 parents afef3b7 + 06f4c19 commit aabef6b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

* perf: insert elements from the tail in `load_data` so reallocation happens only once [#1117](https://github.com/lambdaclass/cairo-rs/pull/1117)

* Add `CairoRunner::get_program method` [#1123](https://github.com/lambdaclass/cairo-rs/pull/1123)

* Use to_signed_felt as function for felt252 as BigInt within [-P/2, P/2] range and use to_bigint as function for representation as BigInt. [#1100](https://github.com/lambdaclass/cairo-rs/pull/1100)

* Implement hint on field_arithmetic lib [#1090](https://github.com/lambdaclass/cairo-rs/pull/1090)
Expand Down
16 changes: 16 additions & 0 deletions src/vm/runners/cairo_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,11 @@ impl CairoRunner {
}
Ok(stack_ptr)
}

/// Return CairoRunner.program
pub fn get_program(&self) -> &Program {
&self.program
}
}

#[derive(Clone, Debug, Eq, PartialEq)]
Expand Down Expand Up @@ -4826,4 +4831,15 @@ mod tests {
}
);
}

#[test]
fn test_get_program() {
let program = program!(
builtins = vec![BuiltinName::output],
data = vec_data!((4), (6)),
);
let runner = cairo_runner!(program);

assert_eq!(runner.get_program().data_len(), 2)
}
}

0 comments on commit aabef6b

Please sign in to comment.