referrerpolicy=no-referrer-when-downgrade

snowbridge_core/
operating_mode.rs

1use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen};
2use scale_info::TypeInfo;
3use sp_runtime::RuntimeDebug;
4
5/// Basic operating modes for a bridges module (Normal/Halted).
6#[derive(
7	Encode,
8	Decode,
9	DecodeWithMemTracking,
10	Clone,
11	Copy,
12	PartialEq,
13	Eq,
14	RuntimeDebug,
15	TypeInfo,
16	MaxEncodedLen,
17)]
18#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
19pub enum BasicOperatingMode {
20	/// Normal mode, when all operations are allowed.
21	Normal,
22	/// The pallet is halted. All non-governance operations are disabled.
23	Halted,
24}
25
26impl Default for BasicOperatingMode {
27	fn default() -> Self {
28		Self::Normal
29	}
30}
31
32impl BasicOperatingMode {
33	pub fn is_halted(&self) -> bool {
34		*self == BasicOperatingMode::Halted
35	}
36}
37
38/// Check whether the export message is paused based on the status of the basic operating mode.
39pub trait ExportPausedQuery {
40	fn is_paused() -> bool;
41}