Function sp_trie::generate_trie_proof
source ยท pub fn generate_trie_proof<'a, L, I, K, DB>(
db: &DB,
root: TrieHash<L>,
keys: I,
) -> Result<Vec<Vec<u8>>, Box<TrieError<L>>>where
L: TrieConfiguration,
I: IntoIterator<Item = &'a K>,
K: 'a + AsRef<[u8]>,
DB: HashDBRef<L::Hash, DBValue>,
Expand description
Create a proof for a subset of keys in a trie.
The keys
may contain any set of keys regardless of each one of them is included
in the db
.
For a key K
that is included in the db
a proof of inclusion is generated.
For a key K
that is not included in the db
a proof of non-inclusion is generated.
These can be later checked in verify_trie_proof
.