Skip to content
Merged
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
4 changes: 3 additions & 1 deletion crates/nargo/src/cli/build_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ use std::path::{Path, PathBuf};
use super::{add_std_lib, write_to_file, PROVER_INPUT_FILE, VERIFIER_INPUT_FILE};

pub(crate) fn run(args: ArgMatches) -> Result<(), CliError> {
let package_dir = std::env::current_dir().unwrap();
let args = args.subcommand_matches("build").unwrap();
let allow_warnings = args.is_present("allow-warnings");

let package_dir = std::env::current_dir().unwrap();
build_from_path(package_dir, allow_warnings)?;
println!("Constraint system successfully built!");
Ok(())
Expand Down
10 changes: 4 additions & 6 deletions crates/nargo/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ pub fn start_cli() {
.about("Noir's package manager")
.version("0.1")
.author("Kevaundray Wedderburn <kevtheappdev@gmail.com>")
.subcommand(App::new("build").about("Builds the constraint system"))
.subcommand(
App::new("build").about("Builds the constraint system").arg(allow_warnings.clone()),
)
.subcommand(App::new("contract").about("Creates the smart contract code for circuit"))
.subcommand(
App::new("new")
Expand All @@ -58,11 +60,7 @@ pub fn start_cli() {
App::new("verify")
.about("Given a proof and a program, verify whether the proof is valid")
.arg(Arg::with_name("proof").help("The proof to verify").required(true))
.arg(
Arg::with_name("allow-warnings")
.long("allow-warnings")
.help("Issue a warning for each unused variable instead of an error"),
),
.arg(allow_warnings.clone()),
)
.subcommand(
App::new("prove")
Expand Down
5 changes: 4 additions & 1 deletion crates/nargo/src/cli/verify_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ use noirc_abi::{input_parser::InputValue, Abi};
use std::{collections::BTreeMap, path::Path, path::PathBuf};

pub(crate) fn run(args: ArgMatches) -> Result<(), CliError> {
let proof_name = args.subcommand_matches("verify").unwrap().value_of("proof").unwrap();
let args = args.subcommand_matches("verify").unwrap();

let proof_name = args.value_of("proof").unwrap();
let mut proof_path = std::path::PathBuf::new();
proof_path.push(Path::new(PROOFS_DIR));

proof_path.push(Path::new(proof_name));
proof_path.set_extension(PROOF_EXT);

let allow_warnings = args.is_present("allow-warnings");
dbg!(args.clone());
let result = verify(proof_name, allow_warnings)?;
println!("Proof verified : {}\n", result);
Ok(())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[package]
authors = [""]
compiler_version = "0.1"

[dependencies]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
x = "1"
y = "2"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main(x : Field, y : pub Field) {

}