Check that validator set is not empty at genesis (#3083)

* Check that the returned validator set is not empty

* Move assert to session module

* Clean up
This commit is contained in:
Bastian Köcher
2019-07-10 14:38:07 +02:00
committed by Gavin Wood
parent df93867620
commit 0366f7b35c
3 changed files with 7 additions and 2 deletions
+2
View File
@@ -316,6 +316,8 @@ decl_storage! {
let initial_validators = T::SelectInitialValidators::select_initial_validators()
.unwrap_or_else(|| config.keys.iter().map(|(ref v, _)| v.clone()).collect());
assert!(!initial_validators.is_empty(), "Empty validator set in genesis block!");
let queued_keys: Vec<_> = initial_validators
.iter()
.cloned()