Skip to content

Commit 1cb0d0f

Browse files
Improve documentation
1 parent ddd8e97 commit 1cb0d0f

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

vm/src/vm/runners/cairo_runner.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,12 @@ impl CairoRunner {
10871087
Ok(())
10881088
}
10891089

1090+
/// Like [run_until_pc](Self::run_until_pc), but makes use of cached compiled hints, which are
1091+
/// available after calling [CairoRunnerBuilder::compile_hints].
1092+
///
1093+
/// To make the hints clonable (and cacheable), the hint data type had to
1094+
/// be changed. To avoid breaking the API, new v2 functions were added that
1095+
/// accept the new hint data.
10901096
pub fn run_until_pc_v2(
10911097
&mut self,
10921098
address: Relocatable,
@@ -1584,10 +1590,9 @@ impl CairoRunner {
15841590
Ok(())
15851591
}
15861592

1593+
/// Like [run_from_entrypoint](Self::run_from_entrypoint), but calls
1594+
/// [run_until_pc_v2](Self::run_until_pc_v2) instead.
15871595
#[allow(clippy::result_large_err)]
1588-
/// Runs a cairo program from a give entrypoint, indicated by its pc offset, with the given arguments.
1589-
/// If `verify_secure` is set to true, [verify_secure_runner] will be called to run extra verifications.
1590-
/// `program_segment_size` is only used by the [verify_secure_runner] function and will be ignored if `verify_secure` is set to false.
15911596
pub fn run_from_entrypoint_v2(
15921597
&mut self,
15931598
entrypoint: usize,

vm/src/vm/vm_core.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,11 @@ impl VirtualMachine {
550550
Ok(())
551551
}
552552

553+
/// Like [step_hint](Self::step_hint), but with a different signature. See
554+
/// [CairoRunner::run_until_pc_v2] for documentation on why the signature
555+
/// had to be changed.
556+
///
557+
/// [CairoRunner::run_until_pc_v2]: crate::vm::runners::cairo_runner::CairoRunner::run_until_pc_v2
553558
#[cfg(feature = "extensive_hints")]
554559
pub fn step_hint(
555560
&mut self,
@@ -583,6 +588,11 @@ impl VirtualMachine {
583588
Ok(())
584589
}
585590

591+
/// Like [step_hint](Self::step_hint), but with a different signature. See
592+
/// [CairoRunner::run_until_pc_v2] for documentation on why the signature
593+
/// had to be changed.
594+
///
595+
/// [CairoRunner::run_until_pc_v2]: crate::vm::runners::cairo_runner::CairoRunner::run_until_pc_v2
586596
#[cfg(feature = "extensive_hints")]
587597
pub fn step_hint_v2(
588598
&mut self,
@@ -681,6 +691,11 @@ impl VirtualMachine {
681691
Ok(())
682692
}
683693

694+
/// Like [step](Self::step), but with a different signature. See
695+
/// [CairoRunner::run_until_pc_v2] for documentation on why the signature
696+
/// had to be changed.
697+
///
698+
/// [CairoRunner::run_until_pc_v2]: crate::vm::runners::cairo_runner::CairoRunner::run_until_pc_v2
684699
pub fn step_v2(
685700
&mut self,
686701
hint_processor: &mut dyn HintProcessor,

0 commit comments

Comments
 (0)