Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

"OR gate" for EnsureOrigin #6182

@xlc

Description

@xlc

Enable something like this

type AddOrigin = EnsureOneOf<
    EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>,
    EnsureProportionMoreThan<_1, _1, AccountId, TechnicalCollective>,
    EnsureRoot<AccountId>,
>

This can also replace all those code

T::AddOrigin::try_origin(origin)
.map(|_| ())
.or_else(ensure_root)?;

Relates to: paritytech/polkadot-sdk#369

Metadata

Metadata

Assignees

No one assigned

    Labels

    J0-enhancementAn additional feature request.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions