pub trait Config: Config {
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>;
type RuntimeCall: Parameter + Dispatchable<RuntimeOrigin = Self::RuntimeOrigin> + GetDispatchInfo + GetCallMetadata + From<Call<Self>> + IsSubType<Call<Self>> + IsType<<Self as Config>::RuntimeCall>;
type PauseOrigin: EnsureOrigin<Self::RuntimeOrigin>;
type UnpauseOrigin: EnsureOrigin<Self::RuntimeOrigin>;
type WhitelistCallNames: Contains<FullNameOf<Self>>;
type MaxNameLen: Get<u32>;
type PauseTooLongNames: Get<bool>;
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§
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 RuntimeCall: Parameter + Dispatchable<RuntimeOrigin = Self::RuntimeOrigin> + GetDispatchInfo + GetCallMetadata + From<Call<Self>> + IsSubType<Call<Self>> + IsType<<Self as Config>::RuntimeCall>
type RuntimeCall: Parameter + Dispatchable<RuntimeOrigin = Self::RuntimeOrigin> + GetDispatchInfo + GetCallMetadata + From<Call<Self>> + IsSubType<Call<Self>> + IsType<<Self as Config>::RuntimeCall>
The overarching call type.
sourcetype PauseOrigin: EnsureOrigin<Self::RuntimeOrigin>
type PauseOrigin: EnsureOrigin<Self::RuntimeOrigin>
The only origin that can pause calls.
sourcetype UnpauseOrigin: EnsureOrigin<Self::RuntimeOrigin>
type UnpauseOrigin: EnsureOrigin<Self::RuntimeOrigin>
The only origin that can un-pause calls.
sourcetype WhitelistCallNames: Contains<FullNameOf<Self>>
type WhitelistCallNames: Contains<FullNameOf<Self>>
Contains all calls that cannot be paused.
The TxMode
pallet cannot pause it’s own calls, and does not need to be explicitly
added here.
sourcetype MaxNameLen: Get<u32>
type MaxNameLen: Get<u32>
Maximum length for pallet and call SCALE encoded string names.
Too long names will not be truncated but handled like
Self::PauseTooLongNames
specifies.
sourcetype PauseTooLongNames: Get<bool>
type PauseTooLongNames: Get<bool>
Specifies if functions and pallets with too long names should be treated as paused.
Setting this to true
ensures that all calls that
are callable, are also pause-able.
Otherwise there could be a situation where a call
is callable but not pause-able, which would could be exploited.