pub fn read_child_trie_value_with<H: Hasher, Q: Query<H, Item=DBValue>, DB>(
	_storage_key: &[u8],
	db: &DB,
	root_slice: &[u8],
	key: &[u8],
	query: Q
) -> Result<Option<Vec<u8>>, Box<TrieError<H::Out>>> where
	DB: hash_db::HashDBRef<H, trie_db::DBValue> + hash_db::PlainDBRef<H::Out, trie_db::DBValue>,
{
	let mut root = H::Out::default();
	root.as_mut().copy_from_slice(root_slice); // root is fetched from DB, not writable by runtime, so it's always valid.

	Ok(TrieDB::<H>::new(&*db, &root)?.get_with(key, query).map(|x| x.map(|val| val.to_vec()))?)
}
/// Read a value from the child trie with given query.
Read a value from the child trie with given query.
Read a value from the child trie with given query .
pub fn read_child_trie_value_with<H: Hasher, Q: Query<H, Item=DBValue>, DB>(
	_storage_key: &[u8],
	db: &DB,
	root_slice: &[u8],
	key: &[u8],
	query: Q
) -> Result<Option<Vec<u8>>, Box<TrieError<H::Out>>> where
	DB: hash_db::HashDBRef<H, trie_db::DBValue> + hash_db::PlainDBRef<H::Out, trie_db::DBValue>,
{
	let mut root = H::Out::default();
	root.as_mut().copy_from_slice(root_slice); // root is fetched from DB, not writable by runtime, so it's always valid.
	Ok(TrieDB::<H>::new(&*db, &root)?.get_with(key, query).map(|x| x.map(|val| val.to_vec()))?)
}
pub fn read_child_trie_value_with < H : Hasher , Q : Query < H , Item = DBValue > , DB > ( _storage_key : & [ u8 ] , db : & DB , root_slice : & [ u8 ] , key : & [ u8 ] , query : Q ) -> Result < Option < Vec < u8 > > , Box < TrieError < H :: Out > > > where DB : hash_db :: HashDBRef < H , trie_db :: DBValue > + hash_db :: PlainDBRef < H :: Out , trie_db :: DBValue > , { let mut root = H :: Out :: default ( ) ; root . as_mut ( ) . copy_from_slice ( root_slice ) ; // root is fetched from DB, not writable by runtime, so it's always valid. Ok ( TrieDB :: < H > :: new ( & * db , & root ) ? . get_with ( key , query ) . map ( | x | x . map ( | val | val . to_vec ( ) ) ) ? ) }
Read a value from the child trie with given query.
Read a value from the child trie with given query .
_storage_key
&[u8]
db
&DB
root_slice
&[u8]
key
&[u8]
query
Q
_storage_key
&[u8]
db
&DB
root_slice
&[u8]
key
&[u8]
query
Q