Sort the output of `solana validators` by active stake (#9459)

automerge
This commit is contained in:
Michael Vines 2020-04-12 17:39:02 -07:00 committed by GitHub
parent 47fc0a5cfa
commit 3f33f4d3a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -1272,7 +1272,9 @@ pub fn process_show_validators(
);
}
for vote_account in vote_accounts.current.into_iter() {
let mut current = vote_accounts.current;
current.sort_by(|a, b| b.activated_stake.cmp(&a.activated_stake));
for vote_account in current.into_iter() {
print_vote_account(
vote_account,
epoch_info.epoch,
@ -1281,7 +1283,9 @@ pub fn process_show_validators(
false,
);
}
for vote_account in vote_accounts.delinquent.into_iter() {
let mut delinquent = vote_accounts.delinquent;
delinquent.sort_by(|a, b| b.activated_stake.cmp(&a.activated_stake));
for vote_account in delinquent.into_iter() {
print_vote_account(
vote_account,
epoch_info.epoch,