ledger-tool cap: delegation owner and stake v2 flag (#13602) (#13607)

* Output delegation owner as well

* Add --enable-stake-program-v2

* Small cleanup and add sanity assertion

* Fix typo...

(cherry picked from commit bcd303a447)

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
This commit is contained in:
mergify[bot]
2020-11-15 20:55:14 +00:00
committed by GitHub
parent b42cda32ff
commit 88b19e10cb
3 changed files with 68 additions and 3 deletions

View File

@@ -1416,13 +1416,17 @@ impl Bank {
self.get_account(&delegation.voter_pubkey),
) {
(Some(stake_account), Some(vote_account)) => {
let vote_owner = vote_account.owner;
let entry = accounts
.entry(delegation.voter_pubkey)
.or_insert((Vec::new(), vote_account));
if let Some(reward_calc_tracer) = reward_calc_tracer {
reward_calc_tracer(&RewardCalculationEvent::Staking(
stake_pubkey,
&InflationPointCalculationEvent::Delegation(*delegation),
&InflationPointCalculationEvent::Delegation(
*delegation,
vote_owner,
),
));
}
entry.0.push((*stake_pubkey, stake_account));