mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 17:47:56 +00:00
Refactor out MaxPossibleReward, fix staking arithmetic (#4041)
* Refactor out MaxPossibleReward, fix staking arithmetic * Fix rounding error in test
This commit is contained in:
@@ -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! {
|
||||
|
||||
Reference in New Issue
Block a user