pub trait OwnedBridgeModule<T: Config> {
type OwnerStorage: StorageValue<T::AccountId, Query = Option<T::AccountId>>;
type OperatingMode: OperatingMode;
type OperatingModeStorage: StorageValue<Self::OperatingMode, Query = Self::OperatingMode>;
const LOG_TARGET: &'static str;
// Provided methods
fn is_halted() -> bool { ... }
fn ensure_owner_or_root(origin: T::RuntimeOrigin) -> Result<(), BadOrigin> { ... }
fn ensure_not_halted() -> Result<(), OwnedBridgeModuleError> { ... }
fn set_owner(
origin: T::RuntimeOrigin,
maybe_owner: Option<T::AccountId>,
) -> DispatchResult { ... }
fn set_operating_mode(
origin: T::RuntimeOrigin,
operating_mode: Self::OperatingMode,
) -> DispatchResult { ... }
fn module_owner() -> Option<T::AccountId> { ... }
fn operating_mode() -> Self::OperatingMode { ... }
}
Expand description
Bridge module that has owner and operating mode
Required Associated Constants§
Sourceconst LOG_TARGET: &'static str
const LOG_TARGET: &'static str
The target that will be used when publishing logs related to this module.
Required Associated Types§
Sourcetype OwnerStorage: StorageValue<T::AccountId, Query = Option<T::AccountId>>
type OwnerStorage: StorageValue<T::AccountId, Query = Option<T::AccountId>>
A storage entry that holds the module Owner
account.
Sourcetype OperatingMode: OperatingMode
type OperatingMode: OperatingMode
Operating mode type of the pallet.
Sourcetype OperatingModeStorage: StorageValue<Self::OperatingMode, Query = Self::OperatingMode>
type OperatingModeStorage: StorageValue<Self::OperatingMode, Query = Self::OperatingMode>
A storage value that holds the pallet operating mode.
Provided Methods§
Sourcefn ensure_owner_or_root(origin: T::RuntimeOrigin) -> Result<(), BadOrigin>
fn ensure_owner_or_root(origin: T::RuntimeOrigin) -> Result<(), BadOrigin>
Ensure that the origin is either root, or PalletOwner
.
Sourcefn ensure_not_halted() -> Result<(), OwnedBridgeModuleError>
fn ensure_not_halted() -> Result<(), OwnedBridgeModuleError>
Ensure that the module is not halted.
Sourcefn set_owner(
origin: T::RuntimeOrigin,
maybe_owner: Option<T::AccountId>,
) -> DispatchResult
fn set_owner( origin: T::RuntimeOrigin, maybe_owner: Option<T::AccountId>, ) -> DispatchResult
Change the owner of the module.
Sourcefn set_operating_mode(
origin: T::RuntimeOrigin,
operating_mode: Self::OperatingMode,
) -> DispatchResult
fn set_operating_mode( origin: T::RuntimeOrigin, operating_mode: Self::OperatingMode, ) -> DispatchResult
Halt or resume all/some module operations.
Sourcefn module_owner() -> Option<T::AccountId>
fn module_owner() -> Option<T::AccountId>
Pallet owner has a right to halt all module operations and then resume it. If it is None
,
then there are no direct ways to halt/resume module operations, but other runtime methods
may still be used to do that (i.e. democracy::referendum to update halt flag directly
or call the set_operating_mode
).
Sourcefn operating_mode() -> Self::OperatingMode
fn operating_mode() -> Self::OperatingMode
The current operating mode of the module. Depending on the mode either all, some, or no transactions will be allowed.
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.