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

fix/short name for circom lib #285

Merged
merged 1 commit into from
Nov 27, 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: 8 additions & 2 deletions co-circom/co-circom/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,11 @@ pub struct GenerateWitnessCli {
/// The path to the circuit file
#[arg(long)]
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub circuit: Option<String>,
pub circuit: Option<PathBuf>,
/// The path to the circuit file
#[arg(long, short = 'l')]
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
pub link_library: Option<Vec<PathBuf>>,
/// The MPC protocol to be used
#[arg(long, value_enum)]
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
Expand Down Expand Up @@ -520,8 +524,9 @@ impl_config!(VerifyCli, VerifyConfig);
// manual one since this is a bit more complex
impl GenerateWitnessConfig {
/// Parse config from file, env, cli
pub fn parse(cli: GenerateWitnessCli) -> Result<Self, ConfigError> {
pub fn parse(mut cli: GenerateWitnessCli) -> Result<Self, ConfigError> {
let simplification_level = cli.simplification_level;
let link_library = cli.link_library.take().unwrap_or_default();
let mut config: GenerateWitnessConfig = if let Some(path) = &cli.config {
Figment::new()
.merge(Toml::file(path))
Expand All @@ -540,6 +545,7 @@ impl GenerateWitnessConfig {
2 => config.compiler.simplification = SimplificationLevel::O2(usize::MAX),
_ => {}
}
config.compiler.link_library.extend(link_library);
Ok(config)
}
}
Expand Down