feat(rank-collective): added new assoc. types#1245
Closed
PraetorP wants to merge 6 commits into
Closed
Conversation
Added associated types( `AddOrigin` & `RemoveOrigin`) to Config
|
The CI pipeline was cancelled due to failure one of the required jobs. |
bkchr
approved these changes
Jan 22, 2024
bkchr
left a comment
Member
There was a problem hiding this comment.
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. | |||
Comment on lines
+543
to
+545
| /// Morpher to disregard the source value. | ||
| pub type Ignore = |_| -> () {}; | ||
|
|
Member
There was a problem hiding this comment.
The naming is not really great and I don't think that we need this as a type here.
Member
There was a problem hiding this comment.
Changed to ReplaceWithDefault. For downstream where we want AddOrigin == PromoteOrigin it could still be helpful.
Member
|
Cannot push. Going to re-open here #3212 |
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Feb 6, 2024
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>
bgallois
pushed a commit
to duniter/duniter-polkadot-sdk
that referenced
this pull request
Mar 25, 2024
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>
bkchr
pushed a commit
that referenced
this pull request
Apr 10, 2024
Signed-off-by: acatangiu <adrian@parity.io>
This was referenced Jun 5, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: