Trait frame_support::traits::TransactionPause
source · 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§
sourcetype CallIdentifier
type CallIdentifier
How to unambiguously identify a call.
For example (pallet_index, call_index)
.
Required Methods§
sourcefn is_paused(call: Self::CallIdentifier) -> bool
fn is_paused(call: Self::CallIdentifier) -> bool
Whether this call is paused.
sourcefn can_pause(call: Self::CallIdentifier) -> bool
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.
sourcefn pause(call: Self::CallIdentifier) -> Result<(), TransactionPauseError>
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
.
sourcefn unpause(call: Self::CallIdentifier) -> Result<(), TransactionPauseError>
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.