More failure codepath tracing (#15246)

This commit is contained in:
Ryo Onodera
2021-02-12 15:24:23 +09:00
committed by GitHub
parent b09114725a
commit 4e99aa5fa6
2 changed files with 52 additions and 4 deletions

View File

@ -2256,6 +2256,7 @@ fn main() {
point_value: Option<PointValue>,
old_credits_observed: Option<u64>,
new_credits_observed: Option<u64>,
skipped_reasons: String,
}
use solana_stake_program::stake_state::InflationPointCalculationEvent;
let mut stake_calcuration_details: HashMap<Pubkey, CalculationDetail> =
@ -2313,7 +2314,7 @@ fn main() {
new_credits_observed,
) => {
detail.old_credits_observed = Some(*old_credits_observed);
detail.new_credits_observed = Some(*new_credits_observed);
detail.new_credits_observed = *new_credits_observed;
}
InflationPointCalculationEvent::Delegation(
delegation,
@ -2328,6 +2329,13 @@ fn main() {
Some(delegation.deactivation_epoch);
}
}
InflationPointCalculationEvent::Skipped(skipped_reason) => {
if detail.skipped_reasons.is_empty() {
detail.skipped_reasons = format!("{:?}", skipped_reason);
} else {
detail.skipped_reasons += &format!("/{:?}", skipped_reason);
}
}
}
}
};