Trait frame_support::traits::SafeMode
source · pub trait SafeMode {
type BlockNumber;
// Required methods
fn remaining() -> Option<Self::BlockNumber>;
fn enter(duration: Self::BlockNumber) -> Result<(), SafeModeError>;
fn extend(duration: Self::BlockNumber) -> Result<(), SafeModeError>;
fn exit() -> Result<(), SafeModeError>;
// Provided method
fn is_entered() -> bool { ... }
}
Expand description
Can put the runtime into a safe mode.
When the runtime entered safe mode, transaction processing for most general transactions is paused.
Required Associated Types§
sourcetype BlockNumber
type BlockNumber
Block number type.
Required Methods§
sourcefn remaining() -> Option<Self::BlockNumber>
fn remaining() -> Option<Self::BlockNumber>
How many more blocks safe mode will stay entered.
If this returns 0
, then safe mode will exit in the next block.
sourcefn enter(duration: Self::BlockNumber) -> Result<(), SafeModeError>
fn enter(duration: Self::BlockNumber) -> Result<(), SafeModeError>
Enter safe mode for duration
blocks.
Should error when already entered with AlreadyEntered
.
sourcefn extend(duration: Self::BlockNumber) -> Result<(), SafeModeError>
fn extend(duration: Self::BlockNumber) -> Result<(), SafeModeError>
Extend safe mode for duration
blocks.
Should error when not entered with AlreadyExited
.
sourcefn exit() -> Result<(), SafeModeError>
fn exit() -> Result<(), SafeModeError>
Exit safe mode immediately.
This takes effect already in the same block.
Provided Methods§
sourcefn is_entered() -> bool
fn is_entered() -> bool
Whether safe mode is entered.