Pass max-total to RewardRemainder on end_era (#5697)

* Pass max-total to RewardRemainder on end_era

* add test and event

* add doc

Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
Jaco Greeff
2020-04-20 13:13:45 +02:00
committed by GitHub
parent 4b1f7d187f
commit 8c52a2dae6
4 changed files with 62 additions and 6 deletions
+3 -2
View File
@@ -21,10 +21,11 @@
use sp_runtime::{Perbill, traits::AtLeast32Bit, curve::PiecewiseLinear};
/// The total payout to all validators (and their nominators) per era.
/// The total payout to all validators (and their nominators) per era and maximum payout.
///
/// Defined as such:
/// `payout = yearly_inflation(npos_token_staked / total_tokens) * total_tokens / era_per_year`
/// `staker-payout = yearly_inflation(npos_token_staked / total_tokens) * total_tokens / era_per_year`
/// `maximum-payout = max_yearly_inflation * total_tokens / era_per_year`
///
/// `era_duration` is expressed in millisecond.
pub fn compute_total_payout<N>(