pub fn prove_read_on_trie_backend<S, H>(
	trie_backend: &TrieBackend<S, H>,
	key: &[u8]
) -> Result<(Option<Vec<u8>>, Vec<Vec<u8>>), Box<Error>>
where
	S: trie_backend_essence::TrieBackendStorage<H>,
	H: Hasher,
	H::Out: Ord + HeapSizeOf
{
	let proving_backend = proving_backend::ProvingBackend::<_, H>::new(trie_backend);
	let result = proving_backend.storage(key).map_err(|e| Box::new(e) as Box<Error>)?;
	Ok((result, proving_backend.extract_proof()))
}
/// Generate storage read proof on pre-created trie backend.
Generate storage read proof on pre-created trie backend.
Generate storage read proof on pre - created trie backend .
pub fn prove_read_on_trie_backend<S, H>(
	trie_backend: &TrieBackend<S, H>,
	key: &[u8]
) -> Result<(Option<Vec<u8>>, Vec<Vec<u8>>), Box<Error>>
where
	S: trie_backend_essence::TrieBackendStorage<H>,
	H: Hasher,
	H::Out: Ord + HeapSizeOf
{
	let proving_backend = proving_backend::ProvingBackend::<_, H>::new(trie_backend);
	let result = proving_backend.storage(key).map_err(|e| Box::new(e) as Box<Error>)?;
	Ok((result, proving_backend.extract_proof()))
}
pub fn prove_read_on_trie_backend < S , H > ( trie_backend : & TrieBackend < S , H > , key : & [ u8 ] ) -> Result < ( Option < Vec < u8 > > , Vec < Vec < u8 > > ) , Box < Error > > where S : trie_backend_essence :: TrieBackendStorage < H > , H : Hasher , H :: Out : Ord + HeapSizeOf { let proving_backend = proving_backend :: ProvingBackend :: < _ , H > :: new ( trie_backend ) ; let result = proving_backend . storage ( key ) . map_err ( | e | Box :: new ( e ) as Box < Error > ) ? ; Ok ( ( result , proving_backend . extract_proof ( ) ) ) }
Generate storage read proof on pre-created trie backend.
Generate storage read proof on pre - created trie backend .
trie_backend
&TrieBackend<S, H>
key
&[u8]
trie_backend
&TrieBackend<S, H>
key
&[u8]