Adds consistency checks for the HostConfiguration (#2087)

* Adds consistency checks for the `HostConfiguration`

Besides that it fixes the chain specs to make the consistency checks happy.

* Update runtime/parachains/src/configuration.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Review feedback and test fixes etc

* Update

* More

* I'm an idiot

* Fix tests...

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
Bastian Köcher
2020-12-08 16:05:00 +01:00
committed by GitHub
parent f28333aedb
commit 575d68a65d
8 changed files with 137 additions and 140 deletions
+14 -1
View File
@@ -33,7 +33,7 @@ use crate::{
};
/// Information about a session change that has just occurred.
#[derive(Default, Clone)]
#[derive(Clone)]
pub struct SessionChangeNotification<BlockNumber> {
/// The new validators in the session.
pub validators: Vec<ValidatorId>,
@@ -49,6 +49,19 @@ pub struct SessionChangeNotification<BlockNumber> {
pub session_index: sp_staking::SessionIndex,
}
impl<BlockNumber: Default + From<u32>> Default for SessionChangeNotification<BlockNumber> {
fn default() -> Self {
Self {
validators: Vec::new(),
queued: Vec::new(),
prev_config: HostConfiguration::default(),
new_config: HostConfiguration::default(),
random_seed: Default::default(),
session_index: Default::default(),
}
}
}
#[derive(Encode, Decode)]
struct BufferedSessionChange<N> {
apply_at: N,