diff --git a/crates/bin/cairo-execute/src/main.rs b/crates/bin/cairo-execute/src/main.rs index e93e44ad0df..86162b6d543 100644 --- a/crates/bin/cairo-execute/src/main.rs +++ b/crates/bin/cairo-execute/src/main.rs @@ -135,8 +135,8 @@ fn main() -> anyhow::Result<()> { let entrypoint = executable .entrypoints .iter() - .find(|e| matches!(e.kind, EntryPointKind::NonReturning)) - .with_context(|| "No function entrypoint found.")?; + .find(|e| matches!(e.kind, EntryPointKind::Standalone)) + .with_context(|| "No `Standalone` entrypoint found.")?; Program::new_for_proof( entrypoint.builtins.clone(), data, @@ -152,8 +152,8 @@ fn main() -> anyhow::Result<()> { let entrypoint = executable .entrypoints .iter() - .find(|e| matches!(e.kind, EntryPointKind::Function)) - .with_context(|| "No function entrypoint found.")?; + .find(|e| matches!(e.kind, EntryPointKind::Bootloader)) + .with_context(|| "No `Bootloader` entrypoint found.")?; Program::new( entrypoint.builtins.clone(), data, diff --git a/crates/cairo-lang-executable/src/executable.rs b/crates/cairo-lang-executable/src/executable.rs index 9c205f1958d..ea14ef941f2 100644 --- a/crates/cairo-lang-executable/src/executable.rs +++ b/crates/cairo-lang-executable/src/executable.rs @@ -32,12 +32,12 @@ impl Executable { ExecutableEntryPoint { builtins: compiled.wrapper.builtins.clone(), offset: 0, - kind: EntryPointKind::NonReturning, + kind: EntryPointKind::Standalone, }, ExecutableEntryPoint { builtins: compiled.wrapper.builtins, offset: non_returning_header.current_code_offset, - kind: EntryPointKind::Function, + kind: EntryPointKind::Bootloader, }, ], } @@ -58,9 +58,13 @@ pub struct ExecutableEntryPoint { /// The kind of an entrypoint. #[derive(Debug, Clone, Serialize, Deserialize)] pub enum EntryPointKind { + /// Entrypoint is for running it using a bootloader. + /// /// The entrypoint is a function, ending with a `ret`, expecting the builtins as its parameters. - Function, + Bootloader, + /// Entrypoint is for running this executable as a standalone program. + /// /// The entrypoint starts with `ap += ` and expected the builtins to be injected /// there, and ends with an infinite loop. - NonReturning, + Standalone, }