Skip to content

Commit

Permalink
chore(nargo)!: Rename nargo gates to nargo info (#2038)
Browse files Browse the repository at this point in the history
* renmae  nargo gates to nargo info

* improve nargo info comment
  • Loading branch information
vezenovm authored Jul 26, 2023
1 parent 4ecf3c4 commit 5907e96
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,25 @@ use crate::errors::CliError;

use super::NargoConfig;

/// Counts the occurrences of different gates in circuit
/// Provides detailed informaton on a circuit
/// Current information provided:
/// 1. The number of ACIR opcodes
/// 2. Counts the final number gates in the circuit used by a backend
#[derive(Debug, Clone, Args)]
pub(crate) struct GatesCommand {
pub(crate) struct InfoCommand {
#[clap(flatten)]
compile_options: CompileOptions,
}

pub(crate) fn run<B: Backend>(
backend: &B,
args: GatesCommand,
args: InfoCommand,
config: NargoConfig,
) -> Result<(), CliError<B>> {
count_gates_with_path(backend, config.program_dir, &args.compile_options)
count_opcodes_and_gates_with_path(backend, config.program_dir, &args.compile_options)
}

fn count_gates_with_path<B: Backend, P: AsRef<Path>>(
fn count_opcodes_and_gates_with_path<B: Backend, P: AsRef<Path>>(
backend: &B,
program_dir: P,
compile_options: &CompileOptions,
Expand Down
6 changes: 3 additions & 3 deletions crates/nargo_cli/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mod check_cmd;
mod codegen_verifier_cmd;
mod compile_cmd;
mod execute_cmd;
mod gates_cmd;
mod info_cmd;
mod init_cmd;
mod lsp_cmd;
mod new_cmd;
Expand Down Expand Up @@ -57,7 +57,7 @@ enum NargoCommand {
Prove(prove_cmd::ProveCommand),
Verify(verify_cmd::VerifyCommand),
Test(test_cmd::TestCommand),
Gates(gates_cmd::GatesCommand),
Info(info_cmd::InfoCommand),
Lsp(lsp_cmd::LspCommand),
}

Expand All @@ -80,7 +80,7 @@ pub fn start_cli() -> eyre::Result<()> {
NargoCommand::Prove(args) => prove_cmd::run(&backend, args, config),
NargoCommand::Verify(args) => verify_cmd::run(&backend, args, config),
NargoCommand::Test(args) => test_cmd::run(&backend, args, config),
NargoCommand::Gates(args) => gates_cmd::run(&backend, args, config),
NargoCommand::Info(args) => info_cmd::run(&backend, args, config),
NargoCommand::CodegenVerifier(args) => codegen_verifier_cmd::run(&backend, args, config),
NargoCommand::Lsp(args) => lsp_cmd::run(&backend, args, config),
}?;
Expand Down
2 changes: 1 addition & 1 deletion crates/noirc_evaluator/src/ssa_refactor/opt/flatten_cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
//! v12 = add v10, v11
//! store v12 at v5 (new store)
use std::{
collections::{HashMap, HashSet, BTreeMap},
collections::{BTreeMap, HashMap, HashSet},
rc::Rc,
};

Expand Down

0 comments on commit 5907e96

Please sign in to comment.