pub fn mortal(period: u64, current: u64) -> Self {
		let period = period.checked_next_power_of_two()
			.unwrap_or(1 << 16)
			.max(4)
			.min(1 << 16);
		let phase = current % period;
		let quantize_factor = (period >> 12).max(1);
		let quantized_phase = phase / quantize_factor * quantize_factor;

		Era::Mortal(period, quantized_phase)
	}
/// Create a new era based on a period (which should be a power of two between 4 and 65536 inclusive)
/// and a block number on which it should start (or, for long periods, be shortly after the start).
Create a new era based on a period (which should be a power of two between 4 and 65536 inclusive)
and a block number on which it should start (or, for long periods, be shortly after the start).
Create a new era based on a period ( which should be a power of two between 4 and 65536 inclusive ) and a block number on which it should start ( or for long periods be shortly after the start ) .
pub fn mortal(period: u64, current: u64) -> Self {
		let period = period.checked_next_power_of_two()
			.unwrap_or(1 << 16)
			.max(4)
			.min(1 << 16);
		let phase = current % period;
		let quantize_factor = (period >> 12).max(1);
		let quantized_phase = phase / quantize_factor * quantize_factor;
		Era::Mortal(period, quantized_phase)
	}
pub fn mortal ( period : u64 , current : u64 ) -> Self { let period = period . checked_next_power_of_two ( ) . unwrap_or ( 1 << 16 ) . max ( 4 ) . min ( 1 << 16 ) ; let phase = current % period ; let quantize_factor = ( period >> 12 ) . max ( 1 ) ; let quantized_phase = phase / quantize_factor * quantize_factor ; Era :: Mortal ( period , quantized_phase ) }
Create a new era based on a period (which should be a power of two between 4 and 65536 inclusive)
and a block number on which it should start (or, for long periods, be shortly after the start).
Create a new era based on a period ( which should be a power of two between 4 and 65536 inclusive ) and a block number on which it should start ( or for long periods be shortly after the start ) .
period
u64
current
u64
period
u64
current
u64