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

feat: default to outputting witness with file named after package #6031

Merged
merged 1 commit into from
Sep 13, 2024
Merged
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
10 changes: 6 additions & 4 deletions tooling/nargo_cli/src/cli/execute_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ use crate::errors::CliError;
#[clap(visible_alias = "e")]
pub(crate) struct ExecuteCommand {
/// Write the execution witness to named file
///
/// Defaults to the name of the package being executed.
witness_name: Option<String>,

/// The name of the toml file which contains the inputs for the prover
Expand Down Expand Up @@ -83,11 +85,11 @@ pub(crate) fn run(args: ExecuteCommand, config: NargoConfig) -> Result<(), CliEr
if let Some(return_value) = return_value {
println!("[{}] Circuit output: {return_value:?}", package.name);
}
if let Some(witness_name) = &args.witness_name {
let witness_path = save_witness_to_dir(witness_stack, witness_name, target_dir)?;

println!("[{}] Witness saved to {}", package.name, witness_path.display());
}
let package_name = package.name.clone().into();
let witness_name = args.witness_name.as_ref().unwrap_or(&package_name);
let witness_path = save_witness_to_dir(witness_stack, witness_name, target_dir)?;
println!("[{}] Witness saved to {}", package.name, witness_path.display());
}
Ok(())
}
Expand Down
Loading