pub fn digest_level_at_block(&self, block: u64) -> Option<(u32, u64, u64)> {
		if !self.is_digest_build_required_at_block(block) {
			return None;
		}

		let mut digest_interval = self.digest_interval;
		let mut current_level = 1u32;
		let mut digest_step = 1u64;
		while current_level < self.digest_levels {
			let new_digest_interval = match digest_interval.checked_mul(self.digest_interval) {
				Some(new_digest_interval) if block % new_digest_interval == 0 => new_digest_interval,
				_ => break,
			};

			digest_step = digest_interval;
			digest_interval = new_digest_interval;
			current_level = current_level + 1;
		}

		Some((
			current_level,
			digest_interval,
			digest_step,
		))
	}
/// Returns Some if digest must be built at given block number.
/// The tuple is:
/// (
///  digest level
///  digest interval (in blocks)
///  step between blocks we're interested in when digest is built
/// )
Returns Some if digest must be built at given block number.
The tuple is:
(
digest level
digest interval (in blocks)
step between blocks we're interested in when digest is built
)
Returns Some if digest must be built at given block number . The tuple is : ( digest level digest interval ( in blocks ) step between blocks we ' re interested in when digest is built )
pub fn digest_level_at_block(&self, block: u64) -> Option<(u32, u64, u64)> {
		if !self.is_digest_build_required_at_block(block) {
			return None;
		}
		let mut digest_interval = self.digest_interval;
		let mut current_level = 1u32;
		let mut digest_step = 1u64;
		while current_level < self.digest_levels {
			let new_digest_interval = match digest_interval.checked_mul(self.digest_interval) {
				Some(new_digest_interval) if block % new_digest_interval == 0 => new_digest_interval,
				_ => break,
			};
			digest_step = digest_interval;
			digest_interval = new_digest_interval;
			current_level = current_level + 1;
		}
		Some((
			current_level,
			digest_interval,
			digest_step,
		))
	}
pub fn digest_level_at_block ( & self , block : u64 ) -> Option < ( u32 , u64 , u64 ) > { if ! self . is_digest_build_required_at_block ( block ) { return None ; } let mut digest_interval = self . digest_interval ; let mut current_level = 1u32 ; let mut digest_step = 1u64 ; while current_level < self . digest_levels { let new_digest_interval = match digest_interval . checked_mul ( self . digest_interval ) { Some ( new_digest_interval ) if block % new_digest_interval == 0 => new_digest_interval , _ => break , } ; digest_step = digest_interval ; digest_interval = new_digest_interval ; current_level = current_level + 1 ; } Some ( ( current_level , digest_interval , digest_step , ) ) }
Returns Some if digest must be built at given block number.
Returns Some if digest must be built at given block number .
&self
block
u64
&self
block
u64