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
+1 -1
View File
@@ -284,7 +284,7 @@ impl<T: Trait> Module<T> {
let mut digest = <Digest<T>>::take();
let extrinsics_root = <ExtrinsicsRoot<T>>::take();
let storage_root = T::Hashing::storage_root();
let storage_changes_root = T::Hashing::storage_changes_root(number.as_());
let storage_changes_root = T::Hashing::storage_changes_root(parent_hash, number.as_() - 1);
// we can't compute changes trie root earlier && put it to the Digest
// because it will include all currently existing temporaries