mirror of https://github.com/vacp2p/zerokit.git
add new path arg (#207)
This commit is contained in:
parent
c6c1bfde91
commit
a1c292cb2e
|
@ -15,6 +15,8 @@ pub(crate) enum Commands {
|
|||
/// Sets a custom config file
|
||||
#[arg(short, long)]
|
||||
config: PathBuf,
|
||||
#[arg(short, long)]
|
||||
tree_config_input: PathBuf,
|
||||
},
|
||||
SetTree {
|
||||
tree_height: usize,
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
use std::io::Cursor;
|
||||
use std::{fs::File, io::Read, path::Path};
|
||||
|
||||
use clap::Parser;
|
||||
|
@ -35,6 +34,7 @@ fn main() -> Result<()> {
|
|||
Some(Commands::NewWithParams {
|
||||
tree_height,
|
||||
config,
|
||||
tree_config_input,
|
||||
}) => {
|
||||
let mut resources: Vec<Vec<u8>> = Vec::new();
|
||||
for filename in ["rln.wasm", "rln_final.zkey", "verification_key.json"] {
|
||||
|
@ -45,13 +45,13 @@ fn main() -> Result<()> {
|
|||
file.read_exact(&mut buffer)?;
|
||||
resources.push(buffer);
|
||||
}
|
||||
let tree_config_input_file = File::open(&tree_config_input)?;
|
||||
state.rln = Some(RLN::new_with_params(
|
||||
*tree_height,
|
||||
resources[0].clone(),
|
||||
resources[1].clone(),
|
||||
resources[2].clone(),
|
||||
// TODO: use appropriate tree_config
|
||||
Cursor::new(""),
|
||||
tree_config_input_file,
|
||||
)?);
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ use color_eyre::Result;
|
|||
use rln::public::RLN;
|
||||
use std::fs::File;
|
||||
|
||||
use crate::config::{InnerConfig, Config};
|
||||
use crate::config::{Config, InnerConfig};
|
||||
|
||||
#[derive(Default)]
|
||||
pub(crate) struct State<'a> {
|
||||
|
|
Loading…
Reference in New Issue