Skip to content
Commit e1248c92 authored by Luke Schoen's avatar Luke Schoen
Browse files

fix: Add assertions to prevent excess votes and computation, and to end...

fix: Add assertions to prevent excess votes and computation, and to end council seat election when no empty seats

* Add assertion to prevent a vote from voters that provide a list of votes that exceeds the desired seats length, since otherise an attacker may be able to submit a very long list of `votes` that far exceeds the amount of candidates and waste more computation than a reasonable voting bond would cover. Added additional associated test that may be run with `cargo test -p srml-council`

* Add assertion so expired council seats are not up for election when desired seat count changes during the voting period such that there are no longer any empty seats

* Update comment to refer to `reporter` instead of `who` (target of inactivity), since the origin is the `reporter`

* Update commment to refer more specifically to how many vote indexes, since `InactiveGracePeriod` is measured in vote indexes

* Update comment for `ApprovalsOf` since previously the comment was a duplicate of the comment for `LastActiveOf`'s

* Create variable to refer to `retaining_seats` to improve readability

* Reference Notes: https://hackmd.io/nr6kPD2sR4urmljtvHs0CQ
parent 34c797e8
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment