Skip to content

Conversation

@PraetorP
Copy link
Owner

@PraetorP PraetorP commented Jul 13, 2023

This PR added associated types(AddOrigin & RemoveOrigin) to Config.It allows you to decouple types and areas of responsibility, since at the moment the same types are responsible for adding and promoting(removing and demoting).

/// The origin required to add a member.
type AddOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = ()>;

/// The origin required to remove a member. The success value indicates the
/// maximum rank *from which* the removal may be.
type RemoveOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = Rank>;

To achieve the backward compatibility, the users of the pallet can use the old type via the new morph:

type AddOrigin = MapSuccess<PromoteOriginType, ReplaceWithDefaultFor<()>>;

Polkadot companion: PraetorP/polkadot#2

@PraetorP PraetorP force-pushed the feature/ranked-collective-config branch 2 times, most recently from 9cfc625 to 9407752 Compare July 14, 2023 05:55
New associated types(`AddOrigin` & `RemoveOrigin`) have been added to `Config`.
@PraetorP PraetorP force-pushed the feature/ranked-collective-config branch from d6525bf to 74254e9 Compare July 14, 2023 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants