1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
use frame_support::PalletId;
use sp_npos_elections::NposSolution;
use sp_runtime::Perbill;
use sp_staking::{EraIndex, SessionIndex};
use crate::*;
use darwinia_staking::{Config, UseNominatorsMap};
pub const MAX_NOMINATIONS: u32 = <NposCompactSolution24 as NposSolution>::LIMIT as u32;
frame_support::parameter_types! {
pub const StakingPalletId: PalletId = PalletId(*b"da/staki");
pub const SessionsPerEra: SessionIndex = PANGOLIN_SESSIONS_PER_ERA;
pub const BondingDurationInEra: EraIndex = BondingDurationInBlockNumber::get()
/ (PANGORO_SESSIONS_PER_ERA as BlockNumber * PANGORO_BLOCKS_PER_SESSION);
pub const BondingDurationInBlockNumber: BlockNumber = 14 * DAYS;
pub const SlashDeferDuration: EraIndex = BondingDurationInEra::get() - 1;
pub const MaxNominatorRewardedPerValidator: u32 = 64;
pub const OffendingValidatorsThreshold: Perbill = Perbill::from_percent(17);
pub const Cap: Balance = RING_HARD_CAP;
pub const TotalPower: Power = TOTAL_POWER;
}
impl Config for Runtime {
type BondingDurationInBlockNumber = BondingDurationInBlockNumber;
type BondingDurationInEra = BondingDurationInEra;
type Cap = Cap;
type ElectionProvider = ElectionProviderMultiPhase;
type Event = Event;
type GenesisElectionProvider = GenesisElectionOf<Self>;
type KtonCurrency = Kton;
type KtonReward = ();
type KtonSlash = KtonTreasury;
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
type NextNewSession = Session;
type OffendingValidatorsThreshold = OffendingValidatorsThreshold;
type PalletId = StakingPalletId;
type RingCurrency = Ring;
type RingReward = ();
type RingRewardRemainder = Treasury;
type RingSlash = Treasury;
type SessionInterface = Self;
type SessionsPerEra = SessionsPerEra;
type SlashCancelOrigin = RootOrAtLeastHalf<CouncilCollective>;
type SlashDeferDuration = SlashDeferDuration;
type SortedListProvider = UseNominatorsMap<Self>;
type TotalPower = TotalPower;
type UnixTime = Timestamp;
type WeightInfo = ();
const MAX_NOMINATIONS: u32 = MAX_NOMINATIONS;
}