Trait bp_runtime::OwnedBridgeModule
source · 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 Types§
type OwnerStorage: StorageValue<T::AccountId, Query = Option<T::AccountId>>
type OperatingMode: OperatingMode
type OperatingModeStorage: StorageValue<Self::OperatingMode, Query = Self::OperatingMode>
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.
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.
Object Safety§
This trait is not object safe.