Trait tx_pause::pallet::Config

source ·
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§

source

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

The overarching event type.

source

type RuntimeCall: Parameter + Dispatchable<RuntimeOrigin = Self::RuntimeOrigin> + GetDispatchInfo + GetCallMetadata + From<Call<Self>> + IsSubType<Call<Self>> + IsType<<Self as Config>::RuntimeCall>

The overarching call type.

source

type PauseOrigin: EnsureOrigin<Self::RuntimeOrigin>

The only origin that can pause calls.

source

type UnpauseOrigin: EnsureOrigin<Self::RuntimeOrigin>

The only origin that can un-pause calls.

source

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.

source

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.

source

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.

source

type WeightInfo: WeightInfo

Implementors§