Refactored in-mem backed to use the actual trie (#5730)

This commit is contained in:
Arkadiy Paronyan
2020-04-23 19:00:36 +02:00
committed by GitHub
parent ca3f54b4af
commit 59f13e6e0d
10 changed files with 180 additions and 305 deletions
@@ -55,11 +55,21 @@ impl<S: TrieBackendStorage<H>, H: Hasher> TrieBackendEssence<S, H> where H::Out:
&self.storage
}
/// Get backend storage reference.
pub fn backend_storage_mut(&mut self) -> &mut S {
&mut self.storage
}
/// Get trie root.
pub fn root(&self) -> &H::Out {
&self.root
}
/// Set trie root. This is useful for testing.
pub fn set_root(&mut self, root: H::Out) {
self.root = root;
}
/// Consumes self and returns underlying storage.
pub fn into_storage(self) -> S {
self.storage