Trait pallet_ocif_staking::pallet::Config

source ·
pub trait Config: Config + Config + Config {
Show 20 associated items type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>; type Currency: LockableCurrency<Self::AccountId, Moment = BlockNumberFor<Self>> + ReservableCurrency<Self::AccountId>; type BlocksPerEra: Get<BlockNumberFor<Self>>; type RegisterDeposit: Get<BalanceOf<Self>>; type MaxStakersPerCore: Get<u32>; type MinimumStakingAmount: Get<BalanceOf<Self>>; type PotId: Get<PalletId>; type ExistentialDeposit: Get<BalanceOf<Self>>; type MaxUnlocking: Get<u32>; type UnbondingPeriod: Get<u32>; type MaxEraStakeValues: Get<u32>; type RewardRatio: Get<(u32, u32)>; type StakeThresholdForActiveCore: Get<BalanceOf<Self>>; type MaxNameLength: Get<u32>; type MaxDescriptionLength: Get<u32>; type MaxImageUrlLength: Get<u32>; type WeightInfo: WeightInfo; type StakingMessage: HandleMessage; type WeightToFee: WeightToFee<Balance = BalanceOf<Self>>; type OnUnbalanced: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::NegativeImbalance>;
}
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§

source

type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>

The overarching event type.

source

type Currency: LockableCurrency<Self::AccountId, Moment = BlockNumberFor<Self>> + ReservableCurrency<Self::AccountId>

The currency used in staking.

source

type BlocksPerEra: Get<BlockNumberFor<Self>>

Number of blocks per era.

source

type RegisterDeposit: Get<BalanceOf<Self>>

Deposit amount that will be reserved as part of new core registration.

source

type MaxStakersPerCore: Get<u32>

Maximum number of unique stakers per core.

source

type MinimumStakingAmount: Get<BalanceOf<Self>>

Minimum amount user must have staked on a core. User can stake less if they already have the minimum staking amount staked.

source

type PotId: Get<PalletId>

Account Identifier from which the internal Pot is generated.

source

type ExistentialDeposit: Get<BalanceOf<Self>>

The minimum amount required to keep an account open.

source

type MaxUnlocking: Get<u32>

Max number of unlocking chunks per account Id <-> core Id pairing. If value is zero, unlocking becomes impossible.

source

type UnbondingPeriod: Get<u32>

Number of eras that need to pass until unstaked value can be withdrawn. When set to 0, it’s equal to having no unbonding period.

source

type MaxEraStakeValues: Get<u32>

Max number of unique EraStake values that can exist for a (staker, core) pairing.

When stakers claims rewards, they will either keep the number of EraStake values the same or they will reduce them by one. Stakers cannot add an additional EraStake value by calling bond&stake or unbond&unstake if they’ve reached the max number of values.

This ensures that history doesn’t grow indefinitely - if there are too many chunks, stakers should first claim their former rewards before adding additional EraStake values.

source

type RewardRatio: Get<(u32, u32)>

Reward ratio of the pot to be distributed between the core and stakers, respectively.

source

type StakeThresholdForActiveCore: Get<BalanceOf<Self>>

Threshold of staked tokens necessary for a core to become active.

source

type MaxNameLength: Get<u32>

Maximum length of a core’s name.

source

type MaxDescriptionLength: Get<u32>

Maximum length of a core’s description.

source

type MaxImageUrlLength: Get<u32>

Maximum length of a core’s image URL.

source

type WeightInfo: WeightInfo

Weight information for extrinsics in this pallet.

source

type StakingMessage: HandleMessage

Message queue interface.

source

type WeightToFee: WeightToFee<Balance = BalanceOf<Self>>

Weight to fee conversion provider, from pallet_transaction_payment.

source

type OnUnbalanced: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::NegativeImbalance>

Fee charghing interface.

Object Safety§

This trait is not object safe.

Implementors§