SafeMode::Call

Variant 328 v393

pallet_safe_mode::pallet::Call

Contains a variant per dispatchable extrinsic that this pallet has.

About This Type

Call enum for the Call pallet.

Contains all dispatchable functions (extrinsics) for the Call pallet. Each variant represents a different callable function with its parameters.

Variants (8)

IndexNameFieldsDocs
0enternoneEnter safe-mode permissionlessly for [`Config::EnterDuration`] blocks. Reserves [`Config::EnterDepositAmount`] from the caller's account. Emits an [`Event::Entered`] event on success. Errors with [`Error::Entered`] if the safe-mode is already entered. Errors with [`Error::NotConfigured`] if the deposit amount is `None`.
1force_enternoneEnter safe-mode by force for a per-origin configured number of blocks. Emits an [`Event::Entered`] event on success. Errors with [`Error::Entered`] if the safe-mode is already entered. Can only be called by the [`Config::ForceEnterOrigin`] origin.
2extendnoneExtend the safe-mode permissionlessly for [`Config::ExtendDuration`] blocks. This accumulates on top of the current remaining duration. Reserves [`Config::ExtendDepositAmount`] from the caller's account. Emits an [`Event::Extended`] event on success. Errors with [`Error::Exited`] if the safe-mode is entered. Errors with [`Error::NotConfigured`] if the deposit amount is `None`. This may be called by any signed origin with [`Config::ExtendDepositAmount`] free currency to reserve. This call can be disabled for all origins by configuring [`Config::ExtendDepositAmount`] to `None`.
3force_extendnoneExtend the safe-mode by force for a per-origin configured number of blocks. Emits an [`Event::Extended`] event on success. Errors with [`Error::Exited`] if the safe-mode is inactive. Can only be called by the [`Config::ForceExtendOrigin`] origin.
4force_exitnoneExit safe-mode by force. Emits an [`Event::Exited`] with [`ExitReason::Force`] event on success. Errors with [`Error::Exited`] if the safe-mode is inactive. Note: `safe-mode` will be automatically deactivated by [`Pallet::on_initialize`] hook after the block height is greater than the [`EnteredUntil`] storage item. Emits an [`Event::Exited`] with [`ExitReason::Timeout`] event when deactivated in the hook.
5force_slash_deposit
account: AccountId
block: u32
Slash a deposit for an account that entered or extended safe-mode at a given historical block. This can only be called while safe-mode is entered. Emits a [`Event::DepositSlashed`] event on success. Errors with [`Error::Entered`] if safe-mode is entered. Can only be called by the [`Config::ForceDepositOrigin`] origin.
6release_deposit
account: AccountId
block: u32
Permissionlessly release a deposit for an account that entered safe-mode at a given historical block. The call can be completely disabled by setting [`Config::ReleaseDelay`] to `None`. This cannot be called while safe-mode is entered and not until [`Config::ReleaseDelay`] blocks have passed since safe-mode was entered. Emits a [`Event::DepositReleased`] event on success. Errors with [`Error::Entered`] if the safe-mode is entered. Errors with [`Error::CannotReleaseYet`] if [`Config::ReleaseDelay`] block have not passed since safe-mode was entered. Errors with [`Error::NoDeposit`] if the payee has no reserved currency at the block specified.
7force_release_deposit
account: AccountId
block: u32
Force to release a deposit for an account that entered safe-mode at a given historical block. This can be called while safe-mode is still entered. Emits a [`Event::DepositReleased`] event on success. Errors with [`Error::Entered`] if safe-mode is entered. Errors with [`Error::NoDeposit`] if the payee has no reserved currency at the specified block. Can only be called by the [`Config::ForceDepositOrigin`] origin.

SCALE Encoding

Rule
1-byte variant index followed by variant-specific field data. 8 possible variants.
Size
variable (1+ bytes)

Examples

enter
0x00
00 Variant index 0 = enter
force_enter
0x01
01 Variant index 1 = force_enter
extend
0x02
02 Variant index 2 = extend

Code Examples

import { TypeRegistry } from "@polkadot/types";

const registry = new TypeRegistry();

// Encode SafeMode::Call — variant "enter"
const value = registry.createType("SafeMode::Call", "enter");
console.log("Hex:", value.toHex());

Type Parameters

T

Referenced By (23)

and 3 more...

Also See

Type Information

Type ID
328
Kind
Variant
Path
pallet_safe_mode::pallet::Call
Runtime
v393