-
Notifications
You must be signed in to change notification settings - Fork 769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(rank-collective): added new assoc. types #1245
feat(rank-collective): added new assoc. types #1245
Conversation
Added associated types( `AddOrigin` & `RemoveOrigin`) to Config
The CI pipeline was cancelled due to failure one of the required jobs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please merge master and provide some prdoc
.
@@ -111,7 +111,12 @@ impl pallet_ranked_collective::Config<FellowshipCollectiveInstance> for Runtime | |||
|
|||
#[cfg(not(feature = "runtime-benchmarks"))] | |||
// Promotions and the induction of new members are serviced by `FellowshipCore` pallet instance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is out of place now.
/// Morpher to disregard the source value. | ||
pub type Ignore = |_| -> () {}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The naming is not really great and I don't think that we need this as a type here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to ReplaceWithDefault
. For downstream where we want AddOrigin == PromoteOrigin
it could still be helpful.
Cannot push. Going to re-open here #3212 |
Superseeds #1245 This PR is a migration of the paritytech/substrate#14577. The 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). This will improve the flexibility of the pallet configuration. ``` /// 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<Self::PromoteOrigin, Ignore>; type RemoveOrigin = Self::DemoteOrigin; ``` --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: PraetorP <praetorian281@gmail.com> Co-authored-by: Pavel Orlov <45266194+PraetorP@users.noreply.github.com>
Superseeds paritytech#1245 This PR is a migration of the paritytech/substrate#14577. The 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). This will improve the flexibility of the pallet configuration. ``` /// 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<Self::PromoteOrigin, Ignore>; type RemoveOrigin = Self::DemoteOrigin; ``` --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: PraetorP <praetorian281@gmail.com> Co-authored-by: Pavel Orlov <45266194+PraetorP@users.noreply.github.com>
Signed-off-by: acatangiu <adrian@parity.io>
This PR is a migration of the paritytech/substrate#14577.
The PR added associated types (
AddOrigin
&RemoveOrigin
) toConfig
. 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). This will improve the flexibility of the pallet configuration.To achieve the backward compatibility, the users of the pallet can use the old type via the new morph: