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

Use ElectionProvider for pallet-elections-phragmen #8250

@kianenigma

Description

@kianenigma

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>

Metadata

Metadata

Assignees

Labels

I7-refactorCode needs refactoring.Z2-mediumCan be fixed by a coder with good Rust knowledge but little knowledge of the codebase.

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions