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§

Required Associated Constants§

source

const LOG_TARGET: &'static str

The target that will be used when publishing logs related to this module.

Provided Methods§

source

fn is_halted() -> bool

Check if the module is halted.

source

fn ensure_owner_or_root(origin: T::RuntimeOrigin) -> Result<(), BadOrigin>

Ensure that the origin is either root, or PalletOwner.

source

fn ensure_not_halted() -> Result<(), OwnedBridgeModuleError>

Ensure that the module is not halted.

source

fn set_owner( origin: T::RuntimeOrigin, maybe_owner: Option<T::AccountId> ) -> DispatchResult

Change the owner of the module.

source

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.

Implementors§