pub trait EnsureOrigin<OuterOrigin> {
    type Success;

    fn try_origin(o: OuterOrigin) -> Result<Self::Success, OuterOrigin>;

    fn ensure_origin(o: OuterOrigin) -> Result<Self::Success, BadOrigin> { ... }
    fn successful_origin() -> OuterOrigin { ... }
    fn try_successful_origin() -> Result<OuterOrigin, ()> { ... }
}
Expand description

Some sort of check on the origin is performed by this object.

Required Associated Types§

A return type.

Required Methods§

Perform the origin check.

Provided Methods§

Perform the origin check.

Returns an outer origin capable of passing try_origin check.

NOTE: This should generally NOT be reimplemented. Instead implement try_successful_origin.

** Should be used for benchmarking only!!! **

Attept to get an outer origin capable of passing try_origin check. May return Err if it is impossible. Default implementation just uses successful_origin().

** Should be used for benchmarking only!!! **

Implementors§

impl<O: Into<Result<RawOrigin<AccountId>, O>> + From<RawOrigin<AccountId>>, AccountId> EnsureOrigin<O> for EnsureRoot<AccountId>

impl<O: Into<Result<RawOrigin<AccountId>, O>> + From<RawOrigin<AccountId>>, AccountId, Success: TypedGet> EnsureOrigin<O> for EnsureRootWithSuccess<AccountId, Success>

impl<O: Into<Result<RawOrigin<AccountId>, O>> + From<RawOrigin<AccountId>>, AccountId: Decode> EnsureOrigin<O> for EnsureSigned<AccountId>

impl<O: Into<Result<RawOrigin<AccountId>, O>> + From<RawOrigin<AccountId>>, Who: SortedMembers<AccountId>, AccountId: PartialEq + Clone + Ord + Decode> EnsureOrigin<O> for EnsureSignedBy<Who, AccountId>

impl<O: Into<Result<RawOrigin<AccountId>, O>> + From<RawOrigin<AccountId>>, AccountId> EnsureOrigin<O> for EnsureNone<AccountId>

impl<O, T> EnsureOrigin<O> for EnsureNever<T>

impl<O: Into<Result<RawOrigin<AccountId, I>, O>> + From<RawOrigin<AccountId, I>>, I, AccountId: Decode> EnsureOrigin<O> for EnsureMember<AccountId, I>

impl<O: Into<Result<RawOrigin<AccountId, I>, O>> + From<RawOrigin<AccountId, I>>, AccountId, I, const N: u32> EnsureOrigin<O> for EnsureMembers<AccountId, I, N>

impl<O: Into<Result<RawOrigin<AccountId, I>, O>> + From<RawOrigin<AccountId, I>>, AccountId, I, const N: u32, const D: u32> EnsureOrigin<O> for EnsureProportionMoreThan<AccountId, I, N, D>

impl<O: Into<Result<RawOrigin<AccountId, I>, O>> + From<RawOrigin<AccountId, I>>, AccountId, I, const N: u32, const D: u32> EnsureOrigin<O> for EnsureProportionAtLeast<AccountId, I, N, D>

impl<T: Config> EnsureOrigin<<T as Config>::Origin> for EnsureFounder<T>

impl<Origin: OriginTrait + Clone, Conversion: Convert<Origin, MultiLocation>> EnsureOrigin<Origin> for EnsureXcmOrigin<Origin, Conversion>where
    Origin::PalletsOrigin: PartialEq,