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 { ... }
}
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.
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.