Allow for customizable recent genesis window

This commit is contained in:
Paul Hauner
2019-08-29 14:59:32 +10:00
parent 3acd75f876
commit 314780e634
5 changed files with 37 additions and 10 deletions

View File

@@ -120,8 +120,15 @@ fn process_testnet_subcommand(
.parse::<usize>()
.map_err(|e| format!("Unable to parse validator_count: {:?}", e))?;
let minutes = cli_args
.value_of("minutes")
.ok_or_else(|| "No recent genesis minutes supplied")?
.parse::<u64>()
.map_err(|e| format!("Unable to parse minutes: {:?}", e))?;
builder.set_beacon_chain_start_method(BeaconChainStartMethod::RecentGenesis {
validator_count,
minutes,
})
}
_ => return Err("No testnet method specified. See 'testnet --help'.".into()),