This repository has been archived by the owner on Aug 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: move compilation logic to FeatureContracts enum
Signed-off-by: Dori Medini <[email protected]>
- Loading branch information
1 parent
4bdfda2
commit 72f5494
Showing
4 changed files
with
91 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
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"); | ||
if let Some(extra_arg) = extra_arg { | ||
command.arg(extra_arg); | ||
} | ||
if !debug_info { | ||
command.args([&path, "--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!(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters