substrate
substrate copied to clipboard
Use ElectionProvider for pallet-elections-phragmen
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>
I'll take a stab at this, might be interesting to be able to move the election offchain.
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.
will take a while, but we want it.
still interesting.
cc @georgesdib
@gpestana