substrate icon indicating copy to clipboard operation
substrate copied to clipboard

Use ElectionProvider for pallet-elections-phragmen

Open kianenigma opened this issue 3 years ago • 6 comments

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 avatar Mar 03 '21 10:03 kianenigma

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

kianenigma avatar Mar 24 '21 16:03 kianenigma

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[bot] avatar Jul 07 '21 20:07 stale[bot]

will take a while, but we want it.

kianenigma avatar Jul 08 '21 09:07 kianenigma

still interesting.

kianenigma avatar Jan 14 '22 14:01 kianenigma

cc @georgesdib

kianenigma avatar Jun 11 '22 12:06 kianenigma

@gpestana

kianenigma avatar Oct 10 '22 13:10 kianenigma