Make use of child storage for testExternalities and basicExternalities (#3009)

* impl test using both storage and child_storage

* few fixes

* remove unused code

* impl PartialEq with children keys

* fmt

* implementation of basic with children + rename new

* assert and test

* no panic in runtime

* address comments

* fix
This commit is contained in:
thiolliere
2019-07-09 21:07:58 +02:00
committed by Gavin Wood
parent 6639ab339a
commit d00a2b28ac
12 changed files with 242 additions and 161 deletions
+6 -6
View File
@@ -238,8 +238,8 @@ mod tests {
}
pub fn build(self) -> runtime_io::TestExternalities<Blake2Hasher> {
self.set_associated_consts();
let mut t = system::GenesisConfig::default().build_storage::<Test>().unwrap().0;
t.extend(balances::GenesisConfig::<Test>{
let mut t = system::GenesisConfig::default().build_storage::<Test>().unwrap();
balances::GenesisConfig::<Test>{
balances: vec![
(1, 10 * self.balance_factor),
(2, 20 * self.balance_factor),
@@ -249,8 +249,8 @@ mod tests {
(6, 60 * self.balance_factor)
],
vesting: vec![],
}.build_storage().unwrap().0);
t.extend(seats::GenesisConfig::<Test> {
}.assimilate_storage(&mut t.0, &mut t.1).unwrap();
seats::GenesisConfig::<Test> {
active_council: if self.with_council { vec![
(1, 10),
(2, 10),
@@ -259,8 +259,8 @@ mod tests {
desired_seats: 2,
presentation_duration: 2,
term_duration: 5,
}.build_storage().unwrap().0);
runtime_io::TestExternalities::new(t)
}.assimilate_storage(&mut t.0, &mut t.1).unwrap();
runtime_io::TestExternalities::new_with_children(t)
}
}