snowbridge_core/
operating_mode.rs

1use codec::{Decode, Encode, MaxEncodedLen};
2use scale_info::TypeInfo;
3use sp_runtime::RuntimeDebug;
4
5/// Basic operating modes for a bridges module (Normal/Halted).
6#[derive(Encode, Decode, Clone, Copy, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)]
7#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8pub enum BasicOperatingMode {
9	/// Normal mode, when all operations are allowed.
10	Normal,
11	/// The pallet is halted. All non-governance operations are disabled.
12	Halted,
13}
14
15impl Default for BasicOperatingMode {
16	fn default() -> Self {
17		Self::Normal
18	}
19}
20
21impl BasicOperatingMode {
22	pub fn is_halted(&self) -> bool {
23		*self == BasicOperatingMode::Halted
24	}
25}