Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add printing details about compilation process #59

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/commands/compile_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ pub struct CompileContract {

/// Compiles Sierra of the Starknet contract.
pub fn compile(mut sierra_json: Value) -> Result<Value> {
println!("Compiling Sierra to Casm using USC...");

Comment on lines +27 to +28
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because using USC almost always involves calling it by other tools, I believe that using the word "USC" here is appropriate

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really think this is helpful 🤔
Maybe we should add information about what is compiled?
Right now this would just print the same text multiple times in snforge - for each contract file.
It could also add cargo-style message at the end to mark finished compiling (e.g. with time it took to compile the file).

sierra_json["abi"] = Value::Null;
sierra_json["sierra_program_debug_info"] = Value::Null;
sierra_json["contract_class_version"] = Value::String(String::new());
Expand Down
2 changes: 2 additions & 0 deletions src/commands/compile_raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ pub struct CompileRaw {

/// Compiles Sierra of the plain Cairo code.
pub fn compile(sierra_program: Value) -> Result<Value> {
println!("Compiling Sierra to Casm using USC...");

let sierra_program: Program = serde_json::from_value(sierra_program)
.context("Unable to deserialize Sierra program. Make sure it is in a correct format")?;
let metadata_config = MetadataComputationConfig::default();
Expand Down
Loading