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
Labels
Z1-easy
Can be fixed primarily by duplicating and adapting code by an intermediate coder
Election Provider defines a bound
MaxWinners
which limits the size of winners it can elect.ElectionProvider
also assumesElectionDataProvider
will respect this bound and return adesired_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 onElectionProvider
which returns an error if the above assumption fails. This is already defined here but unused for now.The text was updated successfully, but these errors were encountered: