Child trie storage proof (#2433)

* proof on child trie

* higher level api for child storage proof

* boilerplate for proof from light fetch

* actually check proof on light fetch

* Do not break former encoding

* tabify

* tabify2

* Add child trie root tx to full_storage_root transaction.

* Shorten long lines.

* Temp rename for audit

* Make full_storage a trait method

* Name back and replace some code with full_storage where it looks fine.

* fix indentations, remove unused import

* flush child root to top when calculated

* impl +1
This commit is contained in:
cheme
2019-05-10 14:31:41 +02:00
committed by Gavin Wood
parent 59be403730
commit 0d8379d5d2
14 changed files with 475 additions and 103 deletions
@@ -159,19 +159,6 @@ impl OverlayedChanges {
}
}
/// Sync the child storage root.
pub(crate) fn sync_child_storage_root(&mut self, storage_key: &[u8], root: Option<Vec<u8>>) {
let entry = self.prospective.top.entry(storage_key.to_vec()).or_default();
entry.value = root;
if let Some((Some(extrinsics), _)) = self.prospective.children.get(storage_key) {
for extrinsic in extrinsics {
entry.extrinsics.get_or_insert_with(Default::default)
.insert(*extrinsic);
}
}
}
/// Clear child storage of given storage key.
///
/// NOTE that this doesn't take place immediately but written into the prospective