Show more detailed vote history in shorter format (#13374)

* Show more detailed vote history in shorter format

* Improve wording

* fmt
This commit is contained in:
Ryo Onodera
2020-11-07 00:07:40 +09:00
committed by GitHub
parent b7811c8992
commit d08c3232e2
2 changed files with 47 additions and 21 deletions

View File

@ -685,13 +685,15 @@ pub fn process_show_vote_account(
for vote in &vote_state.votes {
votes.push(vote.into());
}
for (epoch, credits, prev_credits) in vote_state.epoch_credits() {
for (epoch, credits, prev_credits) in vote_state.epoch_credits().iter().copied() {
let credits_earned = credits - prev_credits;
let slots_in_epoch = epoch_schedule.get_slots_in_epoch(*epoch);
let slots_in_epoch = epoch_schedule.get_slots_in_epoch(epoch);
epoch_voting_history.push(CliEpochVotingHistory {
epoch: *epoch,
epoch,
slots_in_epoch,
credits_earned,
credits,
prev_credits,
});
}
}