Trait pallet_lottery::pallet::Config
source · pub trait Config: Config {
type PalletId: Get<PalletId>;
type RuntimeCall: Parameter + Dispatchable<RuntimeOrigin = Self::RuntimeOrigin> + GetDispatchInfo + From<Call<Self>>;
type Currency: ReservableCurrency<Self::AccountId>;
type Randomness: Randomness<Self::Hash, BlockNumberFor<Self>>;
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>;
type ManagerOrigin: EnsureOrigin<Self::RuntimeOrigin>;
type MaxCalls: Get<u32>;
type ValidateCall: ValidateCall<Self>;
type MaxGenerateRandom: Get<u32>;
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. The pallet’s config trait.
Required Associated Types§
sourcetype RuntimeCall: Parameter + Dispatchable<RuntimeOrigin = Self::RuntimeOrigin> + GetDispatchInfo + From<Call<Self>>
type RuntimeCall: Parameter + Dispatchable<RuntimeOrigin = Self::RuntimeOrigin> + GetDispatchInfo + From<Call<Self>>
A dispatchable call.
sourcetype Currency: ReservableCurrency<Self::AccountId>
type Currency: ReservableCurrency<Self::AccountId>
The currency trait.
sourcetype Randomness: Randomness<Self::Hash, BlockNumberFor<Self>>
type Randomness: Randomness<Self::Hash, BlockNumberFor<Self>>
Something that provides randomness in the runtime.
sourcetype RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>
The overarching event type.
sourcetype ManagerOrigin: EnsureOrigin<Self::RuntimeOrigin>
type ManagerOrigin: EnsureOrigin<Self::RuntimeOrigin>
The manager origin.
sourcetype ValidateCall: ValidateCall<Self>
type ValidateCall: ValidateCall<Self>
Used to determine if a call would be valid for purchasing a ticket.
Be conscious of the implementation used here. We assume at worst that
a vector of MaxCalls
indices are queried for any call validation.
You may need to provide a custom benchmark if this assumption is broken.
sourcetype MaxGenerateRandom: Get<u32>
type MaxGenerateRandom: Get<u32>
Number of time we should try to generate a random number that has no modulo bias. The larger this number, the more potential computation is used for picking the winner, but also the more likely that the chosen winner is done fairly.
sourcetype WeightInfo: WeightInfo
type WeightInfo: WeightInfo
Weight information for extrinsics in this pallet.