pub fn check_execution_proof<Header, E, H>(
	executor: &E,
	request: &RemoteCallRequest<Header>,
	remote_proof: Vec<Vec<u8>>
) -> ClientResult<Vec<u8>>
	where
		Header: HeaderT,
		E: CodeExecutor<H>,
		H: Hasher,
		H::Out: Ord + HeapSizeOf,
{
	let local_state_root = request.header.state_root();
	let root: H::Out = convert_hash(&local_state_root);

	// prepare execution environment + check preparation proof
	let mut changes = OverlayedChanges::default();
	let trie_backend = create_proof_check_backend(root, remote_proof)?;
	let next_block = <Header as HeaderT>::new(
		*request.header.number() + As::sa(1),
		Default::default(),
		Default::default(),
		request.header.hash(),
		Default::default(),
	);
	execution_proof_check_on_trie_backend::<H, _>(
		&trie_backend,
		&mut changes,
		executor,
		"Core_initialize_block",
		&next_block.encode(),
	)?;

	// execute method
	let local_result = execution_proof_check_on_trie_backend::<H, _>(
		&trie_backend,
		&mut changes,
		executor,
		&request.method,
		&request.call_data,
	)?;

	Ok(local_result)
}
/// Check remote contextual execution proof using given backend.
///
/// Method is executed using passed header as environment' current block.
/// Proof shoul include both environment preparation proof and method execution proof.
Check remote contextual execution proof using given backend.
Method is executed using passed header as environment' current block.
Proof shoul include both environment preparation proof and method execution proof.
Check remote contextual execution proof using given backend . Method is executed using passed header as environment ' current block . Proof shoul include both environment preparation proof and method execution proof .
pub fn check_execution_proof<Header, E, H>(
	executor: &E,
	request: &RemoteCallRequest<Header>,
	remote_proof: Vec<Vec<u8>>
) -> ClientResult<Vec<u8>>
	where
		Header: HeaderT,
		E: CodeExecutor<H>,
		H: Hasher,
		H::Out: Ord + HeapSizeOf,
{
	let local_state_root = request.header.state_root();
	let root: H::Out = convert_hash(&local_state_root);
	// prepare execution environment + check preparation proof
	let mut changes = OverlayedChanges::default();
	let trie_backend = create_proof_check_backend(root, remote_proof)?;
	let next_block = <Header as HeaderT>::new(
		*request.header.number() + As::sa(1),
		Default::default(),
		Default::default(),
		request.header.hash(),
		Default::default(),
	);
	execution_proof_check_on_trie_backend::<H, _>(
		&trie_backend,
		&mut changes,
		executor,
		"Core_initialize_block",
		&next_block.encode(),
	)?;
	// execute method
	let local_result = execution_proof_check_on_trie_backend::<H, _>(
		&trie_backend,
		&mut changes,
		executor,
		&request.method,
		&request.call_data,
	)?;
	Ok(local_result)
}
pub fn check_execution_proof < Header , E , H > ( executor : & E , request : & RemoteCallRequest < Header > , remote_proof : Vec < Vec < u8 > > ) -> ClientResult < Vec < u8 > > where Header : HeaderT , E : CodeExecutor < H > , H : Hasher , H :: Out : Ord + HeapSizeOf , { let local_state_root = request . header . state_root ( ) ; let root : H :: Out = convert_hash ( & local_state_root ) ; // prepare execution environment + check preparation proof let mut changes = OverlayedChanges :: default ( ) ; let trie_backend = create_proof_check_backend ( root , remote_proof ) ? ; let next_block = < Header as HeaderT > :: new ( * request . header . number ( ) + As :: sa ( 1 ) , Default :: default ( ) , Default :: default ( ) , request . header . hash ( ) , Default :: default ( ) , ) ; execution_proof_check_on_trie_backend :: < H , _ > ( & trie_backend , & mut changes , executor , " " , & next_block . encode ( ) , ) ? ; // execute method let local_result = execution_proof_check_on_trie_backend :: < H , _ > ( & trie_backend , & mut changes , executor , & request . method , & request . call_data , ) ? ; Ok ( local_result ) }
Check remote contextual execution proof using given backend.
Check remote contextual execution proof using given backend .
executor
&E
request
&RemoteCallRequest<Header>
remote_proof
Vec<Vec<u8>>
executor
&E
request
&RemoteCallRequest<Header>
remote_proof
Vec<Vec<u8>>