From 1f8ef5e640d5cdee12164bf69600b024c7766004 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 19 Apr 2021 18:52:27 +0000 Subject: [PATCH] `solana validators` now shows current epoch credits instead of lifetime credits (#16639) (cherry picked from commit f5f06904c3ac0714b85a36e2d2a7ba5f07f9cb11) Co-authored-by: Michael Vines --- cli-output/src/cli_output.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cli-output/src/cli_output.rs b/cli-output/src/cli_output.rs index 03f9ec11b66b05..9607febb7dfb4e 100644 --- a/cli-output/src/cli_output.rs +++ b/cli-output/src/cli_output.rs @@ -338,7 +338,7 @@ impl fmt::Display for CliValidators { writeln!( f, - "{} {:<44} {:<44} {:>3}% {:>8} {:>10} {:>10} {:>8} {}", + "{} {:<44} {:<44} {:>3}% {:>8} {:>10} {:>13} {:>7} {}", if delinquent { WARNING.to_string() } else { @@ -366,13 +366,13 @@ impl fmt::Display for CliValidators { f, "{}", style(format!( - " {:<44} {:<38} {} {} {} {:>10} {:^8} {}", + " {:<44} {:<38} {} {} {} {:>11} {:^7} {}", "Identity", "Vote Account", "Commission", "Last Vote", "Root Block", - "Credits", + "Epoch Credits", "Version", "Active Stake", )) @@ -482,9 +482,9 @@ impl CliValidator { credits: vote_account .epoch_credits .iter() - .find_map(|(epoch, credits, _)| { + .find_map(|(epoch, credits, pre_credits)| { if *epoch == current_epoch { - Some(*credits) + Some(credits.saturating_sub(*pre_credits)) } else { None }