Removing without_storage_info from scored-pool pallet. (#11996)

* Removing without_storage_info from scored-pool pallet.

* Addressing PR feedback

* typo

* typo

* Addressing PR comments and formatting code

* Removing unwanted import

* Adding a map_err

* cargo fmt

Co-authored-by: parity-processbot <>
This commit is contained in:
Hector Bulgarini
2022-09-08 17:57:42 +02:00
committed by GitHub
parent 5afe00d89c
commit bb680c093c
3 changed files with 80 additions and 38 deletions
+17
View File
@@ -297,3 +297,20 @@ fn candidacy_resubmitting_works() {
assert_eq!(ScoredPool::candidate_exists(who), true);
});
}
#[test]
fn pool_candidates_exceeded() {
new_test_ext().execute_with(|| {
for i in [1, 2, 3, 4, 6] {
let who = i as u64;
assert_ok!(ScoredPool::submit_candidacy(Origin::signed(who)));
let index = find_in_pool(who).expect("entity must be in pool") as u32;
assert_ok!(ScoredPool::score(Origin::signed(ScoreOrigin::get()), who, index, 99));
}
assert_noop!(
ScoredPool::submit_candidacy(Origin::signed(8)),
Error::<Test, _>::TooManyMembers
);
});
}