From 636be95e2aed568de30879e8fe6dfa2cac2fde38 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 3 Feb 2021 06:36:47 +0000 Subject: [PATCH] CLI: Move `solana validators` summary to end of output (#15033) (cherry picked from commit 31d30bb5e81068e98b03a55563c49088342df708) Co-authored-by: Trent Nelson --- cli-output/src/cli_output.rs | 71 ++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/cli-output/src/cli_output.rs b/cli-output/src/cli_output.rs index 43435d8557..72ec4ebaa7 100644 --- a/cli-output/src/cli_output.rs +++ b/cli-output/src/cli_output.rs @@ -362,6 +362,42 @@ impl fmt::Display for CliValidators { }, ) } + writeln!( + f, + "{}", + style(format!( + " {:<44} {:<38} {} {} {} {:>10} {:^8} {}", + "Identity", + "Vote Account", + "Commission", + "Last Vote", + "Root Block", + "Credits", + "Version", + "Active Stake", + )) + .bold() + )?; + for validator in &self.current_validators { + write_vote_account( + f, + validator, + self.total_active_stake, + self.use_lamports_unit, + false, + )?; + } + for validator in &self.delinquent_validators { + write_vote_account( + f, + validator, + self.total_active_stake, + self.use_lamports_unit, + true, + )?; + } + + writeln!(f)?; writeln_name_value( f, "Active Stake:", @@ -413,41 +449,6 @@ impl fmt::Display for CliValidators { )?; } - writeln!(f)?; - writeln!( - f, - "{}", - style(format!( - " {:<44} {:<38} {} {} {} {:>10} {:^8} {}", - "Identity", - "Vote Account", - "Commission", - "Last Vote", - "Root Block", - "Credits", - "Version", - "Active Stake", - )) - .bold() - )?; - for validator in &self.current_validators { - write_vote_account( - f, - validator, - self.total_active_stake, - self.use_lamports_unit, - false, - )?; - } - for validator in &self.delinquent_validators { - write_vote_account( - f, - validator, - self.total_active_stake, - self.use_lamports_unit, - true, - )?; - } Ok(()) } }