pub fn compute_changes_trie_root<'a, B: Backend<H>, S: Storage<H>, H: Hasher>(
	backend: &B,
	storage: Option<&'a S>,
	changes: &OverlayedChanges,
	parent: &'a AnchorBlockId<H::Out>,
) -> Option<(H::Out, Vec<(Vec<u8>, Vec<u8>)>)>
	where
		&'a S: TrieBackendStorage<H>,
		H::Out: Ord + HeapSizeOf,
{
	let input_pairs = prepare_input::<B, S, H>(backend, storage, changes, parent)
		.expect("storage is not allowed to fail within runtime")?;
	let transaction = input_pairs.into_iter()
		.map(Into::into)
		.collect::<Vec<_>>();
	let root = trie_root::<H, _, _, _>(transaction.iter().map(|(k, v)| (&*k, &*v)));

	Some((root, transaction))
}
/// Compute the changes trie root and transaction for given block.
/// Returns None if there's no data to perform computation.
Compute the changes trie root and transaction for given block.
Returns None if there's no data to perform computation.
Compute the changes trie root and transaction for given block . Returns None if there ' s no data to perform computation .
pub fn compute_changes_trie_root<'a, B: Backend<H>, S: Storage<H>, H: Hasher>(
	backend: &B,
	storage: Option<&'a S>,
	changes: &OverlayedChanges,
	parent: &'a AnchorBlockId<H::Out>,
) -> Option<(H::Out, Vec<(Vec<u8>, Vec<u8>)>)>
	where
		&'a S: TrieBackendStorage<H>,
		H::Out: Ord + HeapSizeOf,
{
	let input_pairs = prepare_input::<B, S, H>(backend, storage, changes, parent)
		.expect("storage is not allowed to fail within runtime")?;
	let transaction = input_pairs.into_iter()
		.map(Into::into)
		.collect::<Vec<_>>();
	let root = trie_root::<H, _, _, _>(transaction.iter().map(|(k, v)| (&*k, &*v)));
	Some((root, transaction))
}
pub fn compute_changes_trie_root < ' a , B : Backend < H > , S : Storage < H > , H : Hasher > ( backend : & B , storage : Option < & ' a S > , changes : & OverlayedChanges , parent : & ' a AnchorBlockId < H :: Out > , ) -> Option < ( H :: Out , Vec < ( Vec < u8 > , Vec < u8 > ) > ) > where & ' a S : TrieBackendStorage < H > , H :: Out : Ord + HeapSizeOf , { let input_pairs = prepare_input :: < B , S , H > ( backend , storage , changes , parent ) . expect ( " " ) ? ; let transaction = input_pairs . into_iter ( ) . map ( Into :: into ) . collect :: < Vec < _ > > ( ) ; let root = trie_root :: < H , _ , _ , _ > ( transaction . iter ( ) . map ( | ( k , v ) | ( & * k , & * v ) ) ) ; Some ( ( root , transaction ) ) }
Compute the changes trie root and transaction for given block.
Compute the changes trie root and transaction for given block .
backend
&B
storage
Option<&'a S>
changes
&OverlayedChanges
parent
&'a AnchorBlockId<H::Out>
backend
&B
storage
Option<&'a S>
changes
&OverlayedChanges
parent
&'a AnchorBlockId<H::Out>