referrerpolicy=no-referrer-when-downgrade
polkadot_sdk_frame::traits

Trait TransactionPause

pub trait TransactionPause {
    type CallIdentifier;

    // Required methods
    fn is_paused(call: Self::CallIdentifier) -> bool;
    fn can_pause(call: Self::CallIdentifier) -> bool;
    fn pause(call: Self::CallIdentifier) -> Result<(), TransactionPauseError>;
    fn unpause(call: Self::CallIdentifier) -> Result<(), TransactionPauseError>;
}
Expand description

Can pause specific transactions from being processed.

Note that paused transactions will not be queued for later execution. Instead they will be dropped.

Required Associated Types§

type CallIdentifier

How to unambiguously identify a call.

For example (pallet_index, call_index).

Required Methods§

fn is_paused(call: Self::CallIdentifier) -> bool

Whether this call is paused.

fn can_pause(call: Self::CallIdentifier) -> bool

Whether this call can be paused.

This holds for the current block, but may change in the future.

fn pause(call: Self::CallIdentifier) -> Result<(), TransactionPauseError>

Pause this call immediately.

This takes effect in the same block and must succeed if can_pause returns true.

fn unpause(call: Self::CallIdentifier) -> Result<(), TransactionPauseError>

Unpause this call immediately.

This takes effect in the same block and must succeed if is_paused returns true. This invariant is important to not have un-resumable calls.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

impl<T: Config> TransactionPause for Pallet<T>