Trait pallet_liquidity_rewards::pallet::Config
source · pub trait Config: Config {
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>;
type AdminOrigin: EnsureOrigin<Self::RuntimeOrigin>;
type Balance: Balance + MaxEncodedLen + FixedPointOperand;
type CurrencyId: AssetId + MaxEncodedLen + Clone + Ord;
type GroupId: Parameter + MaxEncodedLen + Ord + Copy;
type Weight: Parameter + MaxEncodedLen + EnsureAdd + Unsigned + FixedPointOperand + Default;
type Rewards: GroupRewards<Balance = Self::Balance, GroupId = Self::GroupId> + AccountRewards<Self::AccountId, Balance = Self::Balance, CurrencyId = Self::CurrencyId> + CurrencyGroupChange<GroupId = Self::GroupId, CurrencyId = Self::CurrencyId> + DistributedRewards<Balance = Self::Balance, GroupId = Self::GroupId>;
type Timer: Time;
type MaxGroups: Get<u32> + TypeInfo;
type MaxChangesPerEpoch: Get<u32> + TypeInfo + Debug + Clone + PartialEq;
type InitialEpochDuration: Get<MomentOf<Self>>;
type WeightInfo: WeightInfo;
}
Expand description
Configuration trait of this pallet.
The main purpose of this trait is to act as an interface between this pallet and the runtime in which it is embedded in. A type, function, or constant in this trait is essentially left to be configured by the runtime that includes this pallet.
Consequently, a runtime that wants to include this pallet must implement this trait.
Required Associated Types§
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>
sourcetype AdminOrigin: EnsureOrigin<Self::RuntimeOrigin>
type AdminOrigin: EnsureOrigin<Self::RuntimeOrigin>
Required origin for admin purposes for configuring groups and currencies.
sourcetype CurrencyId: AssetId + MaxEncodedLen + Clone + Ord
type CurrencyId: AssetId + MaxEncodedLen + Clone + Ord
Type used to identify currencies.
sourcetype Weight: Parameter + MaxEncodedLen + EnsureAdd + Unsigned + FixedPointOperand + Default
type Weight: Parameter + MaxEncodedLen + EnsureAdd + Unsigned + FixedPointOperand + Default
Type used to handle group weights.
sourcetype Rewards: GroupRewards<Balance = Self::Balance, GroupId = Self::GroupId> + AccountRewards<Self::AccountId, Balance = Self::Balance, CurrencyId = Self::CurrencyId> + CurrencyGroupChange<GroupId = Self::GroupId, CurrencyId = Self::CurrencyId> + DistributedRewards<Balance = Self::Balance, GroupId = Self::GroupId>
type Rewards: GroupRewards<Balance = Self::Balance, GroupId = Self::GroupId> + AccountRewards<Self::AccountId, Balance = Self::Balance, CurrencyId = Self::CurrencyId> + CurrencyGroupChange<GroupId = Self::GroupId, CurrencyId = Self::CurrencyId> + DistributedRewards<Balance = Self::Balance, GroupId = Self::GroupId>
The reward system used.
type Timer: Time
sourcetype MaxGroups: Get<u32> + TypeInfo
type MaxGroups: Get<u32> + TypeInfo
Max groups used by this pallet. If this limit is reached, the exceeded groups are either not computed and not stored.
sourcetype MaxChangesPerEpoch: Get<u32> + TypeInfo + Debug + Clone + PartialEq
type MaxChangesPerEpoch: Get<u32> + TypeInfo + Debug + Clone + PartialEq
Max number of changes of the same type enqueued to apply in the next
epoch. Max calls to Pallet::set_group_weight()
or to
Pallet::set_currency_group()
with the same id.
sourcetype InitialEpochDuration: Get<MomentOf<Self>>
type InitialEpochDuration: Get<MomentOf<Self>>
Initial epoch duration.
This value can be updated later using
Pallet::set_epoch_duration()
`.
sourcetype WeightInfo: WeightInfo
type WeightInfo: WeightInfo
Information of runtime weights