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 the new desired_targets_checked method exposed by Election Provider #12756

@Ank4n

Description

@Ank4n

Election Provider defines a bound MaxWinners which limits the size of winners it can elect. ElectionProvider also assumes ElectionDataProvider will respect this bound and return a desired_targets() that is lower than this. As such, this call is unsafe to use and caller is expected to handle the case when above assumption fails.

We can improve on this by introducing a desired_targets_checked() method on ElectionProvider which returns an error if the above assumption fails. This is already defined here but unused for now.

Metadata

Metadata

Assignees

Labels

Z1-easyCan be fixed primarily by duplicating and adapting code by an intermediate coder

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions