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

Use ElectionProvider for pallet-elections-phragmen #8250

Closed
kianenigma opened this issue Mar 3, 2021 · 6 comments · Fixed by #12588
Closed

Use ElectionProvider for pallet-elections-phragmen #8250

kianenigma opened this issue Mar 3, 2021 · 6 comments · Fixed by #12588
Assignees
Labels
I7-refactor Code needs refactoring. Z2-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase.

Comments

@kianenigma
Copy link
Contributor

Refactor away the entire code of the phragmen election this pallet, and essentially rename it to a generic pallet-generic-elections, that can be used with phragmen or whatever else.

The very important details here is that this pallet uses the order of ElectionResult.winners in the current code, and we need to ensure that in the new ElectionProvider::elect()'s Supports return type, the order is maintained. Perhaps each ElectionProvider would implement a const ORDERED: bool, and then the pallet-elections would ensure that it is always true. All in all, we expect to see this new type in pallet-generic-elections's Config:

type ElectionProvider: ElectionProvider<DataProvider = Self, ORDERED = true>
@kianenigma kianenigma added I7-refactor Code needs refactoring. Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be. Z2-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase. labels Mar 3, 2021
@kianenigma kianenigma self-assigned this Mar 24, 2021
@kianenigma
Copy link
Contributor Author

I'll take a stab at this, might be interesting to be able to move the election offchain.

@stale
Copy link

stale bot commented Jul 7, 2021

Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the A5-stale Pull request did not receive any updates in a long time. No review needed at this stage. Close it. label Jul 7, 2021
@kianenigma
Copy link
Contributor Author

will take a while, but we want it.

@stale stale bot removed the A5-stale Pull request did not receive any updates in a long time. No review needed at this stage. Close it. label Jul 8, 2021
@kianenigma
Copy link
Contributor Author

still interesting.

@kianenigma
Copy link
Contributor Author

cc @georgesdib

@kianenigma kianenigma removed their assignment Aug 16, 2022
@kianenigma kianenigma removed the Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be. label Aug 30, 2022
@kianenigma
Copy link
Contributor Author

@gpestana

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I7-refactor Code needs refactoring. Z2-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase.
Projects
Status: Done
2 participants