Skip to content

Commit 5e2dd11

Browse files
refactor: make function_runner module and its methods public
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 153f306 commit 5e2dd11

4 files changed

Lines changed: 5 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ Both branches support Stwo prover opcodes (Blake2s, QM31) since v2.0.0.
1111
---
1212

1313
#### Upcoming Changes
14-
15-
* refactor: add `CairoFunctionRunner` type alias for `CairoRunner` under the `test_utils` feature flag [#2377](https://github.com/starkware-libs/cairo-vm/pull/2377)
16-
* refactor: add `function_runner` feature flag and `CairoFunctionRunner` type alias for `CairoRunner` [#2377](https://github.com/starkware-libs/cairo-vm/pull/2377)
1714
* feat: add `test_helpers` module (`error_utils`, `test_utils`) with `assert_mr_eq!`, `load_cairo_program!` macros and `expect_*` error checkers, behind `test_utils` feature flag [#2378](https://github.com/starkware-libs/cairo-vm/pull/2378)
1815

1916
* Add Stwo cairo runner API [#2351](https://github.com/lambdaclass/cairo-vm/pull/2351)

vm/src/test_helpers/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Test helpers for Cairo VM — enabled by the `function_runner` feature.
2-
1+
//! Test helpers for Cairo VM — enabled by the `test_utils` feature.
2+
#[cfg(feature = "test_utils")]
33
pub mod error_utils;
44
pub mod test_utils;

vm/src/vm/runners/function_runner.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use crate::vm::runners::cairo_runner::{CairoArg, CairoRunner, ORDERED_BUILTIN_LI
1919
use crate::vm::security::verify_secure_runner;
2020

2121
/// Identifies a Cairo function entrypoint either by function name or by program counter.
22-
#[allow(dead_code)]
2322
pub enum EntryPoint<'a> {
2423
Name(&'a str),
2524
Pc(usize),
@@ -75,7 +74,7 @@ impl CairoRunner {
7574
/// Resolves the entrypoint, builds the call stack, runs until the function's end PC,
7675
/// and optionally verifies security constraints.
7776
#[allow(clippy::result_large_err)]
78-
pub(crate) fn run_from_entrypoint(
77+
pub fn run_from_entrypoint(
7978
&mut self,
8079
entrypoint: EntryPoint<'_>,
8180
args: &[CairoArg],
@@ -106,7 +105,7 @@ impl CairoRunner {
106105

107106
/// Resolves `__main__.<entrypoint>` to its PC, following alias chains.
108107
#[allow(clippy::result_large_err)]
109-
pub(crate) fn get_function_pc(&self, entrypoint: &str) -> Result<usize, CairoRunError> {
108+
pub fn get_function_pc(&self, entrypoint: &str) -> Result<usize, CairoRunError> {
110109
let full_name = format!("__main__.{entrypoint}");
111110
let identifier = self
112111
.program

vm/src/vm/runners/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ pub mod builtin_runner;
22
pub mod cairo_pie;
33
pub mod cairo_runner;
44
#[cfg(feature = "test_utils")]
5-
pub(crate) mod function_runner;
5+
pub mod function_runner;

0 commit comments

Comments
 (0)