Skip to content

Commit

Permalink
Runner: use CairoProgram::assemble_ex for producing bytecode, which i…
Browse files Browse the repository at this point in the history
…ncludes constants data
  • Loading branch information
m-kus committed Oct 31, 2024
1 parent 159f67d commit 2550715
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cairo1-run/src/cairo_run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,14 @@ pub fn cairo_run_program(
cairo_run_config.copy_to_output(),
);

let data: Vec<MaybeRelocatable> = instructions
.flat_map(|inst| inst.assemble().encode())
.map(|x| Felt252::from(&x))
.map(MaybeRelocatable::from)
// The bytecode includes all program instructions plus entry/footer,
// plus data from the constants segments.
let data: Vec<MaybeRelocatable> = casm_program
.assemble_ex(&entry_code.instructions, &libfunc_footer)
.bytecode
.into_iter()
.map(Into::<Felt252>::into)
.map(Into::<MaybeRelocatable>::into)
.collect();

let program = if cairo_run_config.proof_mode {
Expand Down

0 comments on commit 2550715

Please sign in to comment.