Refactor out MaxPossibleReward, fix staking arithmetic (#4041)

* Refactor out MaxPossibleReward, fix staking arithmetic

* Fix rounding error in test
This commit is contained in:
Gavin Wood
2019-11-07 12:34:13 +01:00
committed by GitHub
parent dcee91412c
commit bb6b3db57e
6 changed files with 52 additions and 44 deletions
+1 -4
View File
@@ -241,7 +241,7 @@ impl session::historical::Trait for Runtime {
srml_staking_reward_curve::build! {
const REWARD_CURVE: PiecewiseLinear<'static> = curve!(
min_inflation: 0_025_000,
max_inflation: 0_100_000, // 10% - must be equal to MaxReward below.
max_inflation: 0_100_000,
ideal_stake: 0_500_000,
falloff: 0_050_000,
max_piece_count: 40,
@@ -253,8 +253,6 @@ parameter_types! {
pub const SessionsPerEra: sr_staking_primitives::SessionIndex = 6;
pub const BondingDuration: staking::EraIndex = 24 * 28;
pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE;
pub const MaxReward: Perbill = Perbill::from_percent(10);
// ^^^ 10% - must be equal to max_inflation, above.
}
impl staking::Trait for Runtime {
@@ -269,7 +267,6 @@ impl staking::Trait for Runtime {
type BondingDuration = BondingDuration;
type SessionInterface = Self;
type RewardCurve = RewardCurve;
type MaxPossibleReward = MaxReward;
}
parameter_types! {