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
use frame_support::traits::{Currency, LockIdentifier};
use frame_system::pallet_prelude::*;
use crate::*;
pub type RewardPoint = u32;
pub type Balance = u128;
pub type Power = u32;
pub type TsInMs = u64;
pub type StakingLedgerT<T> =
StakingLedger<AccountId<T>, RingBalance<T>, KtonBalance<T>, BlockNumberFor<T>>;
pub type StakingBalanceT<T> = StakingBalance<RingBalance<T>, KtonBalance<T>>;
pub type ExposureT<T> = Exposure<AccountId<T>, RingBalance<T>, KtonBalance<T>>;
pub type AccountId<T> = <T as frame_system::Config>::AccountId;
pub type RingBalance<T> = <RingCurrency<T> as Currency<AccountId<T>>>::Balance;
pub type RingPositiveImbalance<T> = <RingCurrency<T> as Currency<AccountId<T>>>::PositiveImbalance;
pub type RingNegativeImbalance<T> = <RingCurrency<T> as Currency<AccountId<T>>>::NegativeImbalance;
pub type KtonBalance<T> = <KtonCurrency<T> as Currency<AccountId<T>>>::Balance;
pub type KtonPositiveImbalance<T> = <KtonCurrency<T> as Currency<AccountId<T>>>::PositiveImbalance;
pub type KtonNegativeImbalance<T> = <KtonCurrency<T> as Currency<AccountId<T>>>::NegativeImbalance;
type RingCurrency<T> = <T as Config>::RingCurrency;
type KtonCurrency<T> = <T as Config>::KtonCurrency;
pub const LOG_TARGET: &'static str = "runtime::staking";
pub const STAKING_ID: LockIdentifier = *b"da/staki";
pub const MAX_UNLOCKING_CHUNKS: usize = 32;
pub const MONTH_IN_MINUTES: TsInMs = 30 * 24 * 60;
pub const MONTH_IN_MILLISECONDS: TsInMs = MONTH_IN_MINUTES * 60 * 1000;