pub fn prepare_input<'a, B, S, H>(
	backend: &B,
	storage: Option<&'a S>,
	changes: &OverlayedChanges,
	parent: &'a AnchorBlockId<H::Out>,
) -> Result<Option<Vec<InputPair>>, String>
	where
		B: Backend<H>,
		S: Storage<H>,
		&'a S: TrieBackendStorage<H>,
		H: Hasher,
		H::Out: HeapSizeOf,
{
	let (storage, config) = match (storage, changes.changes_trie_config.as_ref()) {
		(Some(storage), Some(config)) => (storage, config),
		_ => return Ok(None),
	};

	let mut input = Vec::new();
	input.extend(prepare_extrinsics_input(
		backend,
		parent.number + 1,
		changes)?);
	input.extend(prepare_digest_input::<_, H>(
		parent,
		config,
		storage)?);

	Ok(Some(input))
}
/// Prepare input pairs for building a changes trie of given block.
///
/// Returns Err if storage error has occured OR if storage haven't returned
/// required data.
/// Returns Ok(None) data required to prepare input pairs is not collected
/// or storage is not provided.
Prepare input pairs for building a changes trie of given block.
Returns Err if storage error has occured OR if storage haven't returned
required data.
Returns Ok(None) data required to prepare input pairs is not collected
or storage is not provided.
Prepare input pairs for building a changes trie of given block . Returns Err if storage error has occured OR if storage haven ' t returned required data . Returns Ok ( None ) data required to prepare input pairs is not collected or storage is not provided .
pub fn prepare_input<'a, B, S, H>(
	backend: &B,
	storage: Option<&'a S>,
	changes: &OverlayedChanges,
	parent: &'a AnchorBlockId<H::Out>,
) -> Result<Option<Vec<InputPair>>, String>
	where
		B: Backend<H>,
		S: Storage<H>,
		&'a S: TrieBackendStorage<H>,
		H: Hasher,
		H::Out: HeapSizeOf,
{
	let (storage, config) = match (storage, changes.changes_trie_config.as_ref()) {
		(Some(storage), Some(config)) => (storage, config),
		_ => return Ok(None),
	};
	let mut input = Vec::new();
	input.extend(prepare_extrinsics_input(
		backend,
		parent.number + 1,
		changes)?);
	input.extend(prepare_digest_input::<_, H>(
		parent,
		config,
		storage)?);
	Ok(Some(input))
}
pub fn prepare_input < ' a , B , S , H > ( backend : & B , storage : Option < & ' a S > , changes : & OverlayedChanges , parent : & ' a AnchorBlockId < H :: Out > , ) -> Result < Option < Vec < InputPair > > , String > where B : Backend < H > , S : Storage < H > , & ' a S : TrieBackendStorage < H > , H : Hasher , H :: Out : HeapSizeOf , { let ( storage , config ) = match ( storage , changes . changes_trie_config . as_ref ( ) ) { ( Some ( storage ) , Some ( config ) ) => ( storage , config ) , _ => return Ok ( None ) , } ; let mut input = Vec :: new ( ) ; input . extend ( prepare_extrinsics_input ( backend , parent . number + 1 , changes ) ? ) ; input . extend ( prepare_digest_input :: < _ , H > ( parent , config , storage ) ? ) ; Ok ( Some ( input ) ) }
Prepare input pairs for building a changes trie of given block.
Prepare input pairs for building a changes trie of 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>