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
+4 -1
View File
@@ -599,7 +599,10 @@ decl_storage! {
| {
with_storage(storage, || {
for &(ref stash, ref controller, balance, ref status) in &config.stakers {
assert!(T::Currency::free_balance(&stash) >= balance);
assert!(
T::Currency::free_balance(&stash) >= balance,
"Stash does not have enough balance to bond."
);
let _ = <Module<T>>::bond(
T::Origin::from(Some(stash.clone()).into()),
T::Lookup::unlookup(controller.clone()),