add filter zeros tool
This commit is contained in:
parent
5b3c3151a7
commit
397e170b41
21
phase2/src/bin/filter_zeros.rs
Normal file
21
phase2/src/bin/filter_zeros.rs
Normal file
@ -0,0 +1,21 @@
|
||||
extern crate phase2;
|
||||
extern crate exitcode;
|
||||
|
||||
use std::fs::File;
|
||||
use phase2::circom_circuit::{load_params_file, filter_params};
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = std::env::args().collect();
|
||||
if args.len() != 3 {
|
||||
println!("Usage: \n<in_params.params> <out_params.params>");
|
||||
std::process::exit(exitcode::USAGE);
|
||||
}
|
||||
let in_params = &args[1];
|
||||
let out_params = &args[2];
|
||||
println!("Exporting {}...", in_params);
|
||||
let mut params = load_params_file(in_params);
|
||||
filter_params(&mut params);
|
||||
let mut writer = File::create(out_params).unwrap();
|
||||
params.write(&mut writer).unwrap();
|
||||
println!("Created {}.", out_params);
|
||||
}
|
Loading…
Reference in New Issue
Block a user