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
+2 -2
View File
@@ -297,7 +297,7 @@ mod tests {
}
fn new_test_ext(code: &[u8], support_changes_trie: bool) -> TestExternalities<Blake2Hasher> {
let mut ext = TestExternalities::new_with_code(code, GenesisConfig {
let mut ext = TestExternalities::new_with_code_with_children(code, GenesisConfig {
aura: Some(Default::default()),
system: Some(SystemConfig {
changes_trie_config: if support_changes_trie { Some(ChangesTrieConfiguration {
@@ -353,7 +353,7 @@ mod tests {
grandpa: Some(GrandpaConfig {
authorities: vec![],
}),
}.build_storage().unwrap().0);
}.build_storage().unwrap());
ext.changes_trie_storage().insert(0, GENESIS_HASH.into(), Default::default());
ext
}