Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
dorimedini-starkware committed Jul 29, 2024
1 parent c60f856 commit fa33b55
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions crates/blockifier/src/test_utils/cairo_compile.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
use std::process::Command;

/// Compiles a Cairo0 program using the deprecated compiler.
pub fn cairo0_compile(path: String, extra_arg: Option<String>, debug_info: bool) -> Vec<u8> {
let mut command = Command::new("starknet-compile-deprecated");
command.arg(&path);
if let Some(extra_arg) = extra_arg {
command.arg(extra_arg);
}
if !debug_info {
command.arg("--no_debug_info");
}
let compile_output = command.output().unwrap();
let stderr_output = String::from_utf8(compile_output.stderr).unwrap();
assert!(compile_output.status.success(), "{stderr_output}");
compile_output.stdout
}

/// Compiles a Cairo1 program using the compiler version set in the Cargo.toml.
pub fn cairo1_compile(_path: String) -> Vec<u8> {
todo!();
}
1 change: 1 addition & 0 deletions crates/blockifier/src/test_utils/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ impl FeatureContract {
};
}
};
// a.
format!(
"feature_contracts/cairo{}/compiled/{}{}.json",
match cairo_version {
Expand Down
Binary file added scripts/__pycache__/merge_branches.cpython-39.pyc
Binary file not shown.

0 comments on commit fa33b55

Please sign in to comment.