Support multi trie in genesis generation (#958)

* Support multi trie in genesis generation

* Fix merge issues
This commit is contained in:
Wei Tang
2018-11-01 16:30:03 +08:00
committed by Gav Wood
parent ac4a188e15
commit b21de8a0b5
45 changed files with 292 additions and 213 deletions
+2 -2
View File
@@ -128,7 +128,7 @@ where
fn child_storage_root_transaction(&mut self, storage_key: &[u8]) -> (Vec<u8>, B::Transaction) {
self.mark_dirty();
let (root, transaction) = {
let (root, is_default, transaction) = {
let delta = self.overlay.committed.children.get(storage_key)
.into_iter()
.flat_map(|map| map.1.iter().map(|(k, v)| (k.clone(), v.clone())))
@@ -139,7 +139,7 @@ where
self.backend.child_storage_root(storage_key, delta)
};
let root_val = if root == default_child_trie_root::<H>(storage_key) {
let root_val = if is_default {
None
} else {
Some(root.clone())