Child trie api changes BREAKING (#4857)

Co-Authored-By: thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
cheme
2020-04-20 15:21:22 +02:00
committed by GitHub
parent 7d9aa81bfc
commit 4ffcf98d8d
64 changed files with 1514 additions and 1655 deletions
+2 -8
View File
@@ -211,9 +211,8 @@ pub fn read_trie_value_with<
Ok(TrieDB::<L>::new(&*db, root)?.get_with(key, query).map(|x| x.map(|val| val.to_vec()))?)
}
/// Determine the default child trie root.
pub fn default_child_trie_root<L: TrieConfiguration>(
_storage_key: &[u8],
/// Determine the empty child trie root.
pub fn empty_child_trie_root<L: TrieConfiguration>(
) -> <L::Hash as Hasher>::Out {
L::trie_root::<_, Vec<u8>, Vec<u8>>(core::iter::empty())
}
@@ -221,7 +220,6 @@ pub fn default_child_trie_root<L: TrieConfiguration>(
/// Determine a child trie root given its ordered contents, closed form. H is the default hasher,
/// but a generic implementation may ignore this type parameter and use other hashers.
pub fn child_trie_root<L: TrieConfiguration, I, A, B>(
_storage_key: &[u8],
input: I,
) -> <L::Hash as Hasher>::Out
where
@@ -235,7 +233,6 @@ pub fn child_trie_root<L: TrieConfiguration, I, A, B>(
/// Determine a child trie root given a hash DB and delta values. H is the default hasher,
/// but a generic implementation may ignore this type parameter and use other hashers.
pub fn child_delta_trie_root<L: TrieConfiguration, I, A, B, DB, RD>(
_storage_key: &[u8],
keyspace: &[u8],
db: &mut DB,
root_data: RD,
@@ -270,7 +267,6 @@ pub fn child_delta_trie_root<L: TrieConfiguration, I, A, B, DB, RD>(
/// Call `f` for all keys in a child trie.
pub fn for_keys_in_child_trie<L: TrieConfiguration, F: FnMut(&[u8]), DB>(
_storage_key: &[u8],
keyspace: &[u8],
db: &DB,
root_slice: &[u8],
@@ -321,7 +317,6 @@ pub fn record_all_keys<L: TrieConfiguration, DB>(
/// Read a value from the child trie.
pub fn read_child_trie_value<L: TrieConfiguration, DB>(
_storage_key: &[u8],
keyspace: &[u8],
db: &DB,
root_slice: &[u8],
@@ -341,7 +336,6 @@ pub fn read_child_trie_value<L: TrieConfiguration, DB>(
/// Read a value from the child trie with given query.
pub fn read_child_trie_value_with<L: TrieConfiguration, Q: Query<L::Hash, Item=DBValue>, DB>(
_storage_key: &[u8],
keyspace: &[u8],
db: &DB,
root_slice: &[u8],