Fix benchmark read/write key tracker for keys in child storages. (#6905)

* WIP: read child trie and write child trie

* add test

* refactor a bit + improve log

* better naming

* trigger CI

* Revert "trigger CI"

This reverts commit d0aadaeb6a12fc6c39f01b3c1b5725d19f085865.
This commit is contained in:
Guillaume Thiolliere
2020-08-24 15:40:16 +02:00
committed by GitHub
parent f04afd596b
commit 9b42720ac5
3 changed files with 128 additions and 33 deletions
@@ -26,7 +26,7 @@ use sp_core::{
use crate::{
trie_backend::TrieBackend,
trie_backend_essence::TrieBackendStorage,
UsageInfo, StorageKey, StorageValue, StorageCollection,
UsageInfo, StorageKey, StorageValue, StorageCollection, ChildStorageCollection,
};
/// A state backend is used to read state data and can have changes committed
@@ -215,7 +215,13 @@ pub trait Backend<H: Hasher>: std::fmt::Debug {
}
/// Commit given transaction to storage.
fn commit(&self, _: H::Out, _: Self::Transaction, _: StorageCollection) -> Result<(), Self::Error> {
fn commit(
&self,
_: H::Out,
_: Self::Transaction,
_: StorageCollection,
_: ChildStorageCollection,
) -> Result<(), Self::Error> {
unimplemented!()
}
@@ -594,6 +594,7 @@ where
changes.transaction_storage_root,
changes.transaction,
changes.main_storage_changes,
changes.child_storage_changes,
).expect(EXT_NOT_ALLOWED_TO_FAIL);
self.mark_dirty();
self.overlay