pub trait EnsureOrigin<OuterOrigin> {
    type Success;

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

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

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

Required Associated Types§

source

type Success

A return type.

Required Methods§

source

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

Perform the origin check.

Provided Methods§

source

fn ensure_origin(o: OuterOrigin) -> Result<Self::Success, BadOrigin>

Perform the origin check.

Implementors§

source§

impl<O, Original: EnsureOrigin<O>, Mutator: Morph<Original::Success>> EnsureOrigin<O> for MapSuccess<Original, Mutator>

§

type Success = <Mutator as Morph<<Original as EnsureOrigin<O>>::Success>>::Outcome

source§

impl<O: Clone, Original: EnsureOrigin<O>, Mutator: TryMorph<Original::Success>> EnsureOrigin<O> for TryMapSuccess<Original, Mutator>

§

type Success = <Mutator as TryMorph<<Original as EnsureOrigin<O>>::Success>>::Outcome

source§

impl<OO, Success> EnsureOrigin<OO> for NeverEnsureOrigin<Success>

§

type Success = Success

source§

impl<OuterOrigin, L: EnsureOrigin<OuterOrigin>, R: EnsureOrigin<OuterOrigin>> EnsureOrigin<OuterOrigin> for EitherOfDiverse<L, R>

§

type Success = Either<<L as EnsureOrigin<OuterOrigin>>::Success, <R as EnsureOrigin<OuterOrigin>>::Success>

source§

impl<OuterOrigin, L: EnsureOrigin<OuterOrigin>, R: EnsureOrigin<OuterOrigin, Success = L::Success>> EnsureOrigin<OuterOrigin> for EitherOf<L, R>

§

type Success = <L as EnsureOrigin<OuterOrigin>>::Success

source§

impl<OuterOrigin, Origin, PrivilegeCmp> EnsureOrigin<OuterOrigin> for EnsureOriginEqualOrHigherPrivilege<Origin, PrivilegeCmp>where Origin: Get<OuterOrigin>, OuterOrigin: Eq, PrivilegeCmp: PrivilegeCmp<OuterOrigin>,

§

type 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>>, AccountId, Success: TypedGet> EnsureOrigin<O> for EnsureRootWithSuccess<AccountId, Success>

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

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

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> EnsureOrigin<O> for EnsureNone<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, 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 EnsureProportionAtLeast<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 EnsureProportionMoreThan<AccountId, I, N, D>

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

impl<T: Config<I>, I: 'static, const MIN_RANK: u16> EnsureOrigin<<T as Config>::RuntimeOrigin> for EnsureMember<T, I, MIN_RANK>

impl<T: Config<I>, I: 'static, const MIN_RANK: u16> EnsureOrigin<<T as Config>::RuntimeOrigin> for EnsureRanked<T, I, MIN_RANK>

impl<T: Config<I>, I: 'static, const MIN_RANK: u16> EnsureOrigin<<T as Config>::RuntimeOrigin> for EnsureRankedMember<T, I, MIN_RANK>

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