fn do_check_proof<Header, Hasher, F>(
	local_root: Header::Hash,
	local_number: Header::Number,
	remote_hash: Header::Hash,
	checker: F,
) -> ClientResult<()>
	where
		Header: HeaderT,
		Hasher: hash_db::Hasher,
		Hasher::Out: Ord + HeapSizeOf,
		F: FnOnce(Hasher::Out, &[u8]) -> ClientResult<Option<Vec<u8>>>,
{
	let root: Hasher::Out = convert_hash(&local_root);
	let local_cht_key = encode_cht_key(local_number);
	let local_cht_value = checker(root, &local_cht_key)?;
	let local_cht_value = local_cht_value.ok_or_else(|| ClientErrorKind::InvalidCHTProof)?;
	let local_hash = decode_cht_value(&local_cht_value).ok_or_else(|| ClientErrorKind::InvalidCHTProof)?;
	match &local_hash[..] == remote_hash.as_ref() {
		true => Ok(()),
		false => Err(ClientErrorKind::InvalidCHTProof.into()),
	}

}
/// Check CHT-based header proof using passed checker function.
Check CHT-based header proof using passed checker function.
Check CHT - based header proof using passed checker function .
fn do_check_proof<Header, Hasher, F>(
	local_root: Header::Hash,
	local_number: Header::Number,
	remote_hash: Header::Hash,
	checker: F,
) -> ClientResult<()>
	where
		Header: HeaderT,
		Hasher: hash_db::Hasher,
		Hasher::Out: Ord + HeapSizeOf,
		F: FnOnce(Hasher::Out, &[u8]) -> ClientResult<Option<Vec<u8>>>,
{
	let root: Hasher::Out = convert_hash(&local_root);
	let local_cht_key = encode_cht_key(local_number);
	let local_cht_value = checker(root, &local_cht_key)?;
	let local_cht_value = local_cht_value.ok_or_else(|| ClientErrorKind::InvalidCHTProof)?;
	let local_hash = decode_cht_value(&local_cht_value).ok_or_else(|| ClientErrorKind::InvalidCHTProof)?;
	match &local_hash[..] == remote_hash.as_ref() {
		true => Ok(()),
		false => Err(ClientErrorKind::InvalidCHTProof.into()),
	}
}
fn do_check_proof < Header , Hasher , F > ( local_root : Header :: Hash , local_number : Header :: Number , remote_hash : Header :: Hash , checker : F , ) -> ClientResult < ( ) > where Header : HeaderT , Hasher : hash_db :: Hasher , Hasher :: Out : Ord + HeapSizeOf , F : FnOnce ( Hasher :: Out , & [ u8 ] ) -> ClientResult < Option < Vec < u8 > > > , { let root : Hasher :: Out = convert_hash ( & local_root ) ; let local_cht_key = encode_cht_key ( local_number ) ; let local_cht_value = checker ( root , & local_cht_key ) ? ; let local_cht_value = local_cht_value . ok_or_else ( | | ClientErrorKind :: InvalidCHTProof ) ? ; let local_hash = decode_cht_value ( & local_cht_value ) . ok_or_else ( | | ClientErrorKind :: InvalidCHTProof ) ? ; match & local_hash [ .. ] == remote_hash . as_ref ( ) { true => Ok ( ( ) ) , false => Err ( ClientErrorKind :: InvalidCHTProof . into ( ) ) , } }
Check CHT-based header proof using passed checker function.
Check CHT - based header proof using passed checker function .
local_root
Header::Hash
local_number
Header::Number
remote_hash
Header::Hash
checker
F
local_root
Header::Hash
local_number
Header::Number
remote_hash
Header::Hash
checker
F