pub fn header_proof_with_cht_size(&self, id: &BlockId<Block>, cht_size: u64) -> error::Result<(Block::Header, Vec<Vec<u8>>)> {
		let proof_error = || error::ErrorKind::Backend(format!("Failed to generate header proof for {:?}", id));
		let header = self.backend.blockchain().expect_header(*id)?;
		let block_num = *header.number();
		let cht_num = cht::block_to_cht_number(cht_size, block_num).ok_or_else(proof_error)?;
		let cht_start = cht::start_number(cht_size, cht_num);
		let headers = (cht_start.as_()..).map(|num| self.block_hash(As::sa(num)));
		let proof = cht::build_proof::<Block::Header, Blake2Hasher, _, _>(cht_size, cht_num, ::std::iter::once(block_num), headers)?;
		Ok((header, proof))
	}
/// Reads given header and generates CHT-based header proof for CHT of given size.
Reads given header and generates CHT-based header proof for CHT of given size.
Reads given header and generates CHT - based header proof for CHT of given size .
pub fn header_proof_with_cht_size(&self, id: &BlockId<Block>, cht_size: u64) -> error::Result<(Block::Header, Vec<Vec<u8>>)> {
		let proof_error = || error::ErrorKind::Backend(format!("Failed to generate header proof for {:?}", id));
		let header = self.backend.blockchain().expect_header(*id)?;
		let block_num = *header.number();
		let cht_num = cht::block_to_cht_number(cht_size, block_num).ok_or_else(proof_error)?;
		let cht_start = cht::start_number(cht_size, cht_num);
		let headers = (cht_start.as_()..).map(|num| self.block_hash(As::sa(num)));
		let proof = cht::build_proof::<Block::Header, Blake2Hasher, _, _>(cht_size, cht_num, ::std::iter::once(block_num), headers)?;
		Ok((header, proof))
	}
pub fn header_proof_with_cht_size ( & self , id : & BlockId < Block > , cht_size : u64 ) -> error :: Result < ( Block :: Header , Vec < Vec < u8 > > ) > { let proof_error = | | error :: ErrorKind :: Backend ( format ! ( " " id ) ) ; let header = self . backend . blockchain ( ) . expect_header ( * id ) ? ; let block_num = * header . number ( ) ; let cht_num = cht :: block_to_cht_number ( cht_size , block_num ) . ok_or_else ( proof_error ) ? ; let cht_start = cht :: start_number ( cht_size , cht_num ) ; let headers = ( cht_start . as_ ( ) .. ) . map ( | num | self . block_hash ( As :: sa ( num ) ) ) ; let proof = cht :: build_proof :: < Block :: Header , Blake2Hasher , _ , _ > ( cht_size , cht_num , :: std :: iter :: once ( block_num ) , headers ) ? ; Ok ( ( header , proof ) ) }
Reads given header and generates CHT-based header proof for CHT of given size.
Reads given header and generates CHT - based header proof for CHT of given size .
&self
id
&BlockId<Block>
cht_size
u64
&self
id
&BlockId<Block>
cht_size
u64