-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(blockifier): move contract compilation logic to separate module…
… + contracts.rs
- Loading branch information
1 parent
e4fc399
commit 11f058a
Showing
4 changed files
with
63 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub mod cairo_compile; | ||
pub mod contracts; | ||
pub mod declare; | ||
pub mod deploy_account; | ||
|
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,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!(); | ||
} |
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