Changes tries: support forks (#950)

* forks support in changes trie storage

* moved convert_hash to primitives

* optimize ChangesTrieRootsStorage::root when anchor is canonicalized
This commit is contained in:
Svyatoslav Nikolsky
2018-11-13 14:17:14 +03:00
committed by Gav Wood
parent 037f9dde10
commit 6e3c56c135
25 changed files with 276 additions and 138 deletions
+2 -2
View File
@@ -157,9 +157,9 @@ pub fn child_storage_root(storage_key: &[u8]) -> Option<Vec<u8>> {
}
/// "Commit" all existing operations and get the resultant storage change root.
pub fn storage_changes_root(block: u64) -> Option<H256> {
pub fn storage_changes_root(parent_hash: [u8; 32], parent_num: u64) -> Option<H256> {
ext::with(|ext|
ext.storage_changes_root(block)
ext.storage_changes_root(parent_hash.into(), parent_num)
).unwrap_or(None)
}