referrerpolicy=no-referrer-when-downgrade

Trait pallet_safe_mode::pallet::Config

source ·
pub trait Config: Config {
Show 15 associated items type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>; type Currency: Inspect<Self::AccountId> + Mutate<Self::AccountId, Reason = Self::RuntimeHoldReason>; type RuntimeHoldReason: From<HoldReason>; type WhitelistedCalls: Contains<Self::RuntimeCall>; type EnterDuration: Get<BlockNumberFor<Self>>; type ExtendDuration: Get<BlockNumberFor<Self>>; type EnterDepositAmount: Get<Option<<<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>>; type ExtendDepositAmount: Get<Option<<<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>>; type ForceEnterOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = BlockNumberFor<Self>>; type ForceExtendOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = BlockNumberFor<Self>>; type ForceExitOrigin: EnsureOrigin<Self::RuntimeOrigin>; type ForceDepositOrigin: EnsureOrigin<Self::RuntimeOrigin>; type Notify: SafeModeNotify; type ReleaseDelay: Get<Option<BlockNumberFor<Self>>>; 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 Currency: Inspect<Self::AccountId> + Mutate<Self::AccountId, Reason = Self::RuntimeHoldReason>

Currency type for this pallet, used for Deposits.

source

type RuntimeHoldReason: From<HoldReason>

The hold reason when reserving funds for entering or extending the safe-mode.

source

type WhitelistedCalls: Contains<Self::RuntimeCall>

Contains all runtime calls in any pallet that can be dispatched even while the safe-mode is entered.

The safe-mode pallet cannot disable it’s own calls, and does not need to be explicitly added here.

source

type EnterDuration: Get<BlockNumberFor<Self>>

For how many blocks the safe-mode will be entered by Pallet::enter.

source

type ExtendDuration: Get<BlockNumberFor<Self>>

For how many blocks the safe-mode can be extended by each Pallet::extend call.

This does not impose a hard limit as the safe-mode can be extended multiple times.

source

type EnterDepositAmount: Get<Option<<<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>>

The amount that will be reserved upon calling Pallet::enter.

None disallows permissionlessly enabling the safe-mode and is a sane default.

source

type ExtendDepositAmount: Get<Option<<<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>>

The amount that will be reserved upon calling Pallet::extend.

None disallows permissionlessly extending the safe-mode and is a sane default.

source

type ForceEnterOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = BlockNumberFor<Self>>

The origin that may call Pallet::force_enter.

The Success value is the number of blocks that this origin can enter safe-mode for.

source

type ForceExtendOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = BlockNumberFor<Self>>

The origin that may call Pallet::force_extend.

The Success value is the number of blocks that this origin can extend the safe-mode.

source

type ForceExitOrigin: EnsureOrigin<Self::RuntimeOrigin>

The origin that may call Pallet::force_enter.

source

type ForceDepositOrigin: EnsureOrigin<Self::RuntimeOrigin>

The only origin that can force to release or slash a deposit.

source

type Notify: SafeModeNotify

Notifies external logic when the safe-mode is being entered or exited.

source

type ReleaseDelay: Get<Option<BlockNumberFor<Self>>>

The minimal duration a deposit will remain reserved after safe-mode is entered or extended, unless Pallet::force_release_deposit is successfully called sooner.

Every deposit is tied to a specific activation or extension, thus each deposit can be released independently after the delay for it has passed.

None disallows permissionlessly releasing the safe-mode deposits and is a sane default.

source

type WeightInfo: WeightInfo

Object Safety§

This trait is not object safe.

Implementors§