pub enum Call<T: Config> {
enter {},
force_enter {},
extend {},
force_extend {},
force_exit {},
force_slash_deposit {
account: T::AccountId,
block: BlockNumberFor<T>,
},
release_deposit {
account: T::AccountId,
block: BlockNumberFor<T>,
},
force_release_deposit {
account: T::AccountId,
block: BlockNumberFor<T>,
},
// some variants omitted
}Expand description
Contains a variant per dispatchable extrinsic that this pallet has.
Variants§
enter
Enter 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.
force_enter
Enter 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.
extend
Extend 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.
force_extend
Extend 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.
force_exit
Exit 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.
force_slash_deposit
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.
release_deposit
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.
force_release_deposit
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.
Implementations§
Source§impl<T: Config> Call<T>
impl<T: Config> Call<T>
Sourcepub fn new_call_variant_enter() -> Self
pub fn new_call_variant_enter() -> Self
Create a call with the variant enter.
Sourcepub fn new_call_variant_force_enter() -> Self
pub fn new_call_variant_force_enter() -> Self
Create a call with the variant force_enter.
Sourcepub fn new_call_variant_extend() -> Self
pub fn new_call_variant_extend() -> Self
Create a call with the variant extend.
Sourcepub fn new_call_variant_force_extend() -> Self
pub fn new_call_variant_force_extend() -> Self
Create a call with the variant force_extend.
Sourcepub fn new_call_variant_force_exit() -> Self
pub fn new_call_variant_force_exit() -> Self
Create a call with the variant force_exit.
Sourcepub fn new_call_variant_force_slash_deposit(
account: T::AccountId,
block: BlockNumberFor<T>,
) -> Self
pub fn new_call_variant_force_slash_deposit( account: T::AccountId, block: BlockNumberFor<T>, ) -> Self
Create a call with the variant force_slash_deposit.
Sourcepub fn new_call_variant_release_deposit(
account: T::AccountId,
block: BlockNumberFor<T>,
) -> Self
pub fn new_call_variant_release_deposit( account: T::AccountId, block: BlockNumberFor<T>, ) -> Self
Create a call with the variant release_deposit.
Sourcepub fn new_call_variant_force_release_deposit(
account: T::AccountId,
block: BlockNumberFor<T>,
) -> Self
pub fn new_call_variant_force_release_deposit( account: T::AccountId, block: BlockNumberFor<T>, ) -> Self
Create a call with the variant force_release_deposit.
Trait Implementations§
Source§impl<T: Config> Authorize for Call<T>
impl<T: Config> Authorize for Call<T>
Source§impl<T: Config> CheckIfFeeless for Call<T>
impl<T: Config> CheckIfFeeless for Call<T>
Source§type Origin = <T as Config>::RuntimeOrigin
type Origin = <T as Config>::RuntimeOrigin
Source§fn is_feeless(&self, origin: &Self::Origin) -> bool
fn is_feeless(&self, origin: &Self::Origin) -> bool
#[pallet::feeless_if]Source§impl<T: Config> Decode for Call<T>
impl<T: Config> Decode for Call<T>
Source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<Self, Error>
Source§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
Source§impl<T: Config> Encode for Call<T>
impl<T: Config> Encode for Call<T>
Source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
Source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
Source§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
Source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Source§impl<T: Config> GetCallIndex for Call<T>
impl<T: Config> GetCallIndex for Call<T>
Source§fn get_call_index(&self) -> u8
fn get_call_index(&self) -> u8
Source§fn get_call_indices() -> &'static [u8] ⓘ
fn get_call_indices() -> &'static [u8] ⓘ
GetCallName.Source§impl<T: Config> GetCallName for Call<T>
impl<T: Config> GetCallName for Call<T>
Source§fn get_call_name(&self) -> &'static str
fn get_call_name(&self) -> &'static str
Source§fn get_call_names() -> &'static [&'static str]
fn get_call_names() -> &'static [&'static str]
GetCallIndex.Source§impl<T: Config> GetDispatchInfo for Call<T>
impl<T: Config> GetDispatchInfo for Call<T>
Source§fn get_dispatch_info(&self) -> DispatchInfo
fn get_dispatch_info(&self) -> DispatchInfo
DispatchInfo, containing relevant information of this dispatch. Read moreSource§impl<T> TypeInfo for Call<T>where
PhantomData<(T,)>: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
BlockNumberFor<T>: TypeInfo + 'static,
T: Config + 'static,
impl<T> TypeInfo for Call<T>where
PhantomData<(T,)>: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
BlockNumberFor<T>: TypeInfo + 'static,
T: Config + 'static,
Source§impl<T: Config> UnfilteredDispatchable for Call<T>
impl<T: Config> UnfilteredDispatchable for Call<T>
Source§type RuntimeOrigin = <T as Config>::RuntimeOrigin
type RuntimeOrigin = <T as Config>::RuntimeOrigin
frame_system::Config::RuntimeOrigin).Source§fn dispatch_bypass_filter(
self,
origin: Self::RuntimeOrigin,
) -> DispatchResultWithPostInfo
fn dispatch_bypass_filter( self, origin: Self::RuntimeOrigin, ) -> DispatchResultWithPostInfo
impl<T: Config> DecodeWithMemTracking for Call<T>
impl<T: Config> EncodeLike for Call<T>
impl<T: Config> Eq for Call<T>
Auto Trait Implementations§
impl<T> Freeze for Call<T>
impl<T> RefUnwindSafe for Call<T>where
<T as Config>::RuntimeEvent: Sized,
<T as Config>::AccountId: RefUnwindSafe,
<<<T as Config>::Block as Block>::Header as Header>::Number: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Call<T>
impl<T> Sync for Call<T>
impl<T> Unpin for Call<T>
impl<T> UnwindSafe for Call<T>where
<T as Config>::RuntimeEvent: Sized,
<T as Config>::AccountId: UnwindSafe,
<<<T as Config>::Block as Block>::Header as Header>::Number: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
Source§impl<T> DecodeWithMemLimit for Twhere
T: DecodeWithMemTracking,
impl<T> DecodeWithMemLimit for Twhere
T: DecodeWithMemTracking,
Source§impl<T, U> DefensiveTruncateInto<U> for Twhere
U: DefensiveTruncateFrom<T>,
impl<T, U> DefensiveTruncateInto<U> for Twhere
U: DefensiveTruncateFrom<T>,
Source§fn defensive_truncate_into(self) -> U
fn defensive_truncate_into(self) -> U
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
fn into_tuple(self) -> Dest
Source§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
Source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
Source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
Source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T. Read moreSource§impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
Source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
Source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from.Source§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
Source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T.