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

* Output delegation owner as well

* Add --enable-stake-program-v2

* Small cleanup and add sanity assertion

* Fix typo...
This commit is contained in:
Ryo Onodera
2020-11-16 04:38:46 +09:00
committed by GitHub
parent 5e8490ab9d
commit bcd303a447
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));