diff --git a/leo/main.rs b/leo/main.rs index b1a509cdba..2d4aaa1e41 100644 --- a/leo/main.rs +++ b/leo/main.rs @@ -1,115 +1,3 @@ -// use leo_program::{self, ast}; -// -// use snarkos_algorithms::snark::{ -// create_random_proof, generate_random_parameters, prepare_verifying_key, verify_proof, -// }; -// use snarkos_curves::bls12_377::{Bls12_377, Fr}; -// use snarkos_errors::gadgets::SynthesisError; -// use snarkos_models::{ -// curves::{Field, PrimeField}, -// gadgets::r1cs::{ConstraintSynthesizer, ConstraintSystem}, -// }; -// -// use from_pest::FromPest; -// use rand::thread_rng; -// use std::{ -// fs, -// marker::PhantomData, -// time::{Duration, Instant}, -// }; -// -// pub struct Benchmark { -// _engine: PhantomData, -// } -// -// impl Benchmark { -// pub fn init() -> Self { -// Self { -// _engine: PhantomData, -// } -// } -// } -// -// impl ConstraintSynthesizer for Benchmark { -// fn generate_constraints>( -// self, -// cs: &mut CS, -// ) -> Result<(), SynthesisError> { -// // Read in file as string -// let unparsed_file = fs::read_to_string("simple.leo").expect("cannot read file"); -// -// // Parse the file using leo.pest -// let mut file = ast::parse(&unparsed_file).expect("unsuccessful parse"); -// -// // Build the abstract syntax tree -// let syntax_tree = ast::File::from_pest(&mut file).expect("infallible"); -// // println!("{:#?}", syntax_tree); -// -// let program = leo_program::Program::<'_, F>::from(syntax_tree); -// println!(" compiled: {:#?}", program); -// -// let program = program.name("simple".into()); -// leo_program::ResolvedProgram::generate_constraints(cs, program); -// -// Ok(()) -// } -// } -// -// fn main() { -// let mut setup = Duration::init(0, 0); -// let mut proving = Duration::init(0, 0); -// let mut verifying = Duration::init(0, 0); -// -// let rng = &mut thread_rng(); -// -// let start = Instant::now(); -// -// let params = { -// let circuit = Benchmark::::init(); -// generate_random_parameters::(circuit, rng).unwrap() -// }; -// -// let prepared_verifying_key = prepare_verifying_key::(¶ms.vk); -// -// setup += start.elapsed(); -// -// let start = Instant::now(); -// let proof = { -// let c = Benchmark::init(); -// create_random_proof(c, ¶ms, rng).unwrap() -// }; -// -// proving += start.elapsed(); -// -// // let _inputs: Vec<_> = [1u32; 1].to_vec(); -// -// let start = Instant::now(); -// -// let is_success = verify_proof(&prepared_verifying_key, &proof, &[]).unwrap(); -// -// verifying += start.elapsed(); -// -// println!(" "); -// println!(" Setup time : {:?} milliseconds", setup.as_millis()); -// println!(" Prover time : {:?} milliseconds", proving.as_millis()); -// println!( -// " Verifier time : {:?} milliseconds", -// verifying.as_millis() -// ); -// println!(" Verifier output : {}", is_success); -// println!(" "); -// -// // let mut cs = TestConstraintSystem::::init(); -// // -// // println!("\n satisfied: {:?}", cs.is_satisfied()); -// // -// // println!( -// // "\n number of constraints for input: {}", -// // cs.num_constraints() -// // ); -// // -// } - use leo::{cli::*, commands::*, logger}; use leo::errors::CLIError; @@ -129,7 +17,8 @@ fn main() -> Result<(), CLIError> { AppSettings::DisableVersion, AppSettings::SubcommandRequiredElseHelp, ]) - .subcommands(vec![ // TODO (howardwu): Print subcommands in non-alphabetical order, instead print as ordered here. + // TODO (howardwu): Print subcommands in non-alphabetical order, instead print as ordered here. + .subcommands(vec![ NewCommand::new(), InitCommand::new(), RunCommand::new(),