add beacon_hash as arg

This commit is contained in:
Alexey 2020-04-13 14:13:10 +03:00
parent f17a1ad70f
commit d3cc6d3a5b

@ -21,14 +21,15 @@ const CHECK_INPUT_CORRECTNESS: CheckForCorrectness = CheckForCorrectness::No;
#[allow(clippy::modulo_one)]
fn main() {
let args: Vec<String> = std::env::args().collect();
if args.len() != 5 {
println!("Usage: \n<challenge_file> <response_file> <circuit_power> <batch_size>");
if args.len() != 6 {
println!("Usage: \n<challenge_file> <response_file> <circuit_power> <batch_size> <beacon_hash>");
std::process::exit(exitcode::USAGE);
}
let challenge_filename = &args[1];
let response_filename = &args[2];
let circuit_power = args[3].parse().expect("could not parse circuit power");
let batch_size = args[4].parse().expect("could not parse batch size");
let beacon_hash = args[5];
let parameters = CeremonyParams::<Bn256>::new(circuit_power, batch_size);
@ -49,9 +50,7 @@ fn main() {
use rand::chacha::ChaChaRng;
use rand::SeedableRng;
// Place block hash here (block number #564321)
let mut cur_hash: [u8; 32] =
hex!("0000000000000000000a558a61ddc8ee4e488d647a747fe4dcc362fe2026c620");
let mut cur_hash: [u8; 32] = hex!(beacon_hash);
// Performs 2^n hash iterations over it
const N: u64 = 10;