Allow pallet-election-provider to accept smaller solutions as well (#10905)

* Allow `pallet-election-provider` to accept smaller
solutions, issue #9478

* Fixing a typo

* Adding some more tests
Removing a seemingly outdated comment

* making it a URL

* Updating test name as per suggestion

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Updating documentation to be more explicit

And to follow the general guidelines

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Fixing formatting

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
Georges
2022-03-17 12:52:26 +00:00
committed by GitHub
parent be45d83aa2
commit 1c4afdad22
3 changed files with 54 additions and 8 deletions
@@ -1044,8 +1044,13 @@ mod tests {
roll_to(25);
assert!(MultiPhase::current_phase().is_unsigned());
// Force the number of winners to be bigger to fail
let (mut solution, _) =
MultiPhase::mine_solution::<<Runtime as Config>::Solver>().unwrap();
solution.solution.votes1[0].1 = 4;
assert_eq!(
MultiPhase::mine_check_save_submit().unwrap_err(),
MultiPhase::basic_checks(&solution, "mined").unwrap_err(),
MinerError::PreDispatchChecksFailed(DispatchError::Module(ModuleError {
index: 2,
error: 1,