Skip to content
Snippets Groups Projects
Commit 996107ee authored by Gavin Wood's avatar Gavin Wood Committed by GitHub
Browse files

Session key should be settable at genesis even for non-endowed accounts (#8942)

* Session key should be settable at genesis even for non-endowed accounts

* Docs
parent 2fa35d70
Branches
No related merge requests found
......@@ -442,11 +442,13 @@ decl_storage! {
for (account, val, keys) in config.keys.iter().cloned() {
<Module<T>>::inner_set_keys(&val, keys)
.expect("genesis config must not contain duplicates; qed");
assert!(
frame_system::Pallet::<T>::inc_consumers(&account).is_ok(),
"Account ({:?}) does not exist at genesis to set key. Account not endowed?",
account,
);
if frame_system::Pallet::<T>::inc_consumers(&account).is_err() {
// This will leak a provider reference, however it only happens once (at
// genesis) so it's really not a big deal and we assume that the user wants to
// do this since it's the only way a non-endowed account can contain a session
// key.
frame_system::Pallet::<T>::inc_providers(&account);
}
}
let initial_validators_0 = T::SessionManager::new_session(0)
......
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