fix change flag name end_after_checks to continue_after_checks (#1573)

## Issue Addressed

Resolve #1387 

## Proposed Changes

Replace flag name **end_after_checks** to ** continue_after_checks**
Change condition to simple (remove **!**, It's no change logic.)

## Additional Info

Operation check
- [x] subcommand `eth1-sim` with ganach-cli
  - [x] `./simulator eth1-sim` -> test is completes
  - [x] `./simulator eth1-sim --continue_after_checks` -> test is never completes
  - [x] `./simulator eth1-sim -c` -> test is never completes
  - [x] `./simulator eth1-sim -c true` -> error: Found (clap)
  - [x] `./simulator eth1-sim -c false` -> error: Found (clap)
- [x] subcommand `no-eth1-sim`
  - [x] `./simulator no-eth1-sim` -> test is completes
  - [x] `./simulator no-eth1-sim --continue_after_checks` -> test is never completes
  - [x] `./simulator no-eth1-sim -c` -> test is never completes
  - [x] `./simulator no-eth1-sim -c true` -> error: Found (clap)
  - [x] `./simulator no-eth1-sim -c false` -> error: Found (clap)
This commit is contained in:
tobisako 2020-08-27 23:21:21 +00:00
parent 967700c1ff
commit b6340ec495
3 changed files with 16 additions and 16 deletions

View File

@ -36,11 +36,11 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
.takes_value(true) .takes_value(true)
.default_value("4") .default_value("4")
.help("Speed up factor")) .help("Speed up factor"))
.arg(Arg::with_name("end_after_checks") .arg(Arg::with_name("continue_after_checks")
.short("e") .short("c")
.long("end_after_checks") .long("continue_after_checks")
.takes_value(false) .takes_value(false)
.help("End after checks (default true)")) .help("Continue after checks (default false)"))
) )
.subcommand( .subcommand(
SubCommand::with_name("no-eth1-sim") SubCommand::with_name("no-eth1-sim")
@ -64,11 +64,11 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
.takes_value(true) .takes_value(true)
.default_value("4") .default_value("4")
.help("Speed up factor")) .help("Speed up factor"))
.arg(Arg::with_name("end_after_checks") .arg(Arg::with_name("continue_after_checks")
.short("e") .short("c")
.long("end_after_checks") .long("continue_after_checks")
.takes_value(false) .takes_value(false)
.help("End after checks (default true)")) .help("Continue after checks (default false)"))
) )
.subcommand( .subcommand(
SubCommand::with_name("syncing-sim") SubCommand::with_name("syncing-sim")

View File

@ -17,12 +17,12 @@ pub fn run_eth1_sim(matches: &ArgMatches) -> Result<(), String> {
.expect("missing validators_per_node default"); .expect("missing validators_per_node default");
let speed_up_factor = let speed_up_factor =
value_t!(matches, "speed_up_factor", u64).expect("missing speed_up_factor default"); value_t!(matches, "speed_up_factor", u64).expect("missing speed_up_factor default");
let end_after_checks = !matches.is_present("end_after_checks"); let continue_after_checks = matches.is_present("continue_after_checks");
println!("Beacon Chain Simulator:"); println!("Beacon Chain Simulator:");
println!(" nodes:{}", node_count); println!(" nodes:{}", node_count);
println!(" validators_per_node:{}", validators_per_node); println!(" validators_per_node:{}", validators_per_node);
println!(" end_after_checks:{}", end_after_checks); println!(" continue_after_checks:{}", continue_after_checks);
// Generate the directories and keystores required for the validator clients. // Generate the directories and keystores required for the validator clients.
let validator_files = (0..node_count) let validator_files = (0..node_count)
@ -174,9 +174,9 @@ pub fn run_eth1_sim(matches: &ArgMatches) -> Result<(), String> {
onboarding?; onboarding?;
// The `final_future` either completes immediately or never completes, depending on the value // The `final_future` either completes immediately or never completes, depending on the value
// of `end_after_checks`. // of `continue_after_checks`.
if !end_after_checks { if continue_after_checks {
future::pending::<()>().await; future::pending::<()>().await;
} }
/* /*

View File

@ -17,12 +17,12 @@ pub fn run_no_eth1_sim(matches: &ArgMatches) -> Result<(), String> {
.expect("missing validators_per_node default"); .expect("missing validators_per_node default");
let speed_up_factor = let speed_up_factor =
value_t!(matches, "speed_up_factor", u64).expect("missing speed_up_factor default"); value_t!(matches, "speed_up_factor", u64).expect("missing speed_up_factor default");
let end_after_checks = !matches.is_present("end_after_checks"); let continue_after_checks = matches.is_present("continue_after_checks");
println!("Beacon Chain Simulator:"); println!("Beacon Chain Simulator:");
println!(" nodes:{}", node_count); println!(" nodes:{}", node_count);
println!(" validators_per_node:{}", validators_per_node); println!(" validators_per_node:{}", validators_per_node);
println!(" end_after_checks:{}", end_after_checks); println!(" continue_after_checks:{}", continue_after_checks);
// Generate the directories and keystores required for the validator clients. // Generate the directories and keystores required for the validator clients.
let validator_files = (0..node_count) let validator_files = (0..node_count)
@ -141,9 +141,9 @@ pub fn run_no_eth1_sim(matches: &ArgMatches) -> Result<(), String> {
start_checks?; start_checks?;
// The `final_future` either completes immediately or never completes, depending on the value // The `final_future` either completes immediately or never completes, depending on the value
// of `end_after_checks`. // of `continue_after_checks`.
if !end_after_checks { if continue_after_checks {
future::pending::<()>().await; future::pending::<()>().await;
} }
/* /*