Trait EnsureAddressOrigin

Source
pub trait EnsureAddressOrigin<OuterOrigin> {
    type Success;

    // Required method
    fn try_address_origin(
        address: &H160,
        origin: OuterOrigin,
    ) -> Result<Self::Success, OuterOrigin>;

    // Provided method
    fn ensure_address_origin(
        address: &H160,
        origin: OuterOrigin,
    ) -> Result<Self::Success, BadOrigin> { ... }
}

Required Associated Types§

Source

type Success

Success return type.

Required Methods§

Source

fn try_address_origin( address: &H160, origin: OuterOrigin, ) -> Result<Self::Success, OuterOrigin>

Try with origin.

Provided Methods§

Source

fn ensure_address_origin( address: &H160, origin: OuterOrigin, ) -> Result<Self::Success, BadOrigin>

Perform the origin check.

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.

Implementors§

Source§

impl<OuterOrigin> EnsureAddressOrigin<OuterOrigin> for EnsureAccountId20
where OuterOrigin: Into<Result<RawOrigin<AccountId20>, OuterOrigin>> + From<RawOrigin<AccountId20>>,

Source§

impl<OuterOrigin> EnsureAddressOrigin<OuterOrigin> for EnsureAddressSame
where OuterOrigin: Into<Result<RawOrigin<H160>, OuterOrigin>> + From<RawOrigin<H160>>,

Source§

type Success = H160

Source§

impl<OuterOrigin> EnsureAddressOrigin<OuterOrigin> for EnsureAddressTruncated
where OuterOrigin: Into<Result<RawOrigin<AccountId32>, OuterOrigin>> + From<RawOrigin<AccountId32>>,

Source§

type Success = AccountId32

Source§

impl<OuterOrigin, AccountId> EnsureAddressOrigin<OuterOrigin> for EnsureAddressNever<AccountId>

Source§

type Success = AccountId

Source§

impl<OuterOrigin, AccountId> EnsureAddressOrigin<OuterOrigin> for EnsureAddressRoot<AccountId>
where OuterOrigin: Into<Result<RawOrigin<AccountId>, OuterOrigin>> + From<RawOrigin<AccountId>>,