Trait pallet_provide_randomness::pallet::Config
source · pub trait Config: Config<Hash = H256> {
type Currency: Balanced<Self::AccountId> + Mutate<Self::AccountId>;
type GetCurrentEpochIndex: Get<u64>;
type MaxRequests: Get<u32>;
type RequestPrice: Get<BalanceOf<Self>>;
type OnFilledRandomness: OnFilledRandomness;
type OnUnbalanced: OnUnbalanced<Credit<Self::AccountId, Self::Currency>>;
type ParentBlockRandomness: Randomness<Option<H256>, BlockNumberFor<Self>>;
type RandomnessFromOneEpochAgo: Randomness<H256, BlockNumberFor<Self>>;
type RuntimeEvent: From<Event> + IsType<<Self as Config>::RuntimeEvent>;
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. Configuration trait.
Required Associated Types§
type Currency: Balanced<Self::AccountId> + Mutate<Self::AccountId>
sourcetype GetCurrentEpochIndex: Get<u64>
type GetCurrentEpochIndex: Get<u64>
Type providing the current epoch index.
sourcetype MaxRequests: Get<u32>
type MaxRequests: Get<u32>
Maximum number of not yet filled requests.
sourcetype RequestPrice: Get<BalanceOf<Self>>
type RequestPrice: Get<BalanceOf<Self>>
The price of a request.
sourcetype OnFilledRandomness: OnFilledRandomness
type OnFilledRandomness: OnFilledRandomness
Handler called when randomness is filled.
sourcetype OnUnbalanced: OnUnbalanced<Credit<Self::AccountId, Self::Currency>>
type OnUnbalanced: OnUnbalanced<Credit<Self::AccountId, Self::Currency>>
Handler for unbalanced reduction when the requestor pays fees.
sourcetype ParentBlockRandomness: Randomness<Option<H256>, BlockNumberFor<Self>>
type ParentBlockRandomness: Randomness<Option<H256>, BlockNumberFor<Self>>
A safe source of randomness from the parent block.
sourcetype RandomnessFromOneEpochAgo: Randomness<H256, BlockNumberFor<Self>>
type RandomnessFromOneEpochAgo: Randomness<H256, BlockNumberFor<Self>>
A safe source of randomness from one epoch ago.
sourcetype RuntimeEvent: From<Event> + IsType<<Self as Config>::RuntimeEvent>
type RuntimeEvent: From<Event> + IsType<<Self as Config>::RuntimeEvent>
The overarching event type.
sourcetype WeightInfo: WeightInfo
type WeightInfo: WeightInfo
Type representing the weight of this pallet.