fn authoring_rewards_in_era(active_era: EraIndex) -> BalanceOf<T> {
        // TODO: Enable this in the main net
        // // Milliseconds per year for the Julian year (365.25 days).
        // const MILLISECONDS_PER_YEAR: u64 = 1000 * 3600 * 24 * 36525 / 100;
        // // Initial with total rewards per year
        // let year_in_eras = MILLISECONDS_PER_YEAR / MILLISECS_PER_BLOCK / (EPOCH_DURATION_IN_BLOCKS * T::SessionsPerEra::get()) as u64;
        //
        // let reward_this_era = BLOCK_AUTHORING_REWARDS / year_in_eras as u128;
        //
        // reward_this_era.try_into().ok().unwrap()
        let mut maybe_rewards_this_quarter = FIRST_QUARTER_AUTHORING_REWARDS ;
        const MILLISECONDS_PER_QUARTER: u64 = 1000 * 3600 * 24 * 9000 / 100;
        // 1 quarter = (90d * 24h * 3600s * 1000ms) / (millisecs_in_era = block_time * blocks_num_in_era)
        let quarter_in_eras = MILLISECONDS_PER_QUARTER / MILLISECS_PER_BLOCK / (EPOCH_DURATION_IN_BLOCKS * T::SessionsPerEra::get()) as u64;
        let quarter_num = active_era.saturating_sub(Self::start_reward_era()) as u64 / quarter_in_eras;
        for _ in 0..quarter_num {
            maybe_rewards_this_quarter = maybe_rewards_this_quarter / 2;
        }
        let reward_this_era = maybe_rewards_this_quarter / quarter_in_eras as u128;
        reward_this_era.try_into().ok().unwrap()
    }
/// Block authoring rewards per era, this won't be changed in every era
Block authoring rewards per era, this won't be changed in every era
Block authoring rewards per era this won ' t be changed in every era
fn authoring_rewards_in_era(active_era: EraIndex) -> BalanceOf<T> {
        // TODO: Enable this in the main net
        // // Milliseconds per year for the Julian year (365.25 days).
        // const MILLISECONDS_PER_YEAR: u64 = 1000 * 3600 * 24 * 36525 / 100;
        // // Initial with total rewards per year
        // let year_in_eras = MILLISECONDS_PER_YEAR / MILLISECS_PER_BLOCK / (EPOCH_DURATION_IN_BLOCKS * T::SessionsPerEra::get()) as u64;
        //
        // let reward_this_era = BLOCK_AUTHORING_REWARDS / year_in_eras as u128;
        //
        // reward_this_era.try_into().ok().unwrap()
        let mut maybe_rewards_this_quarter = FIRST_QUARTER_AUTHORING_REWARDS ;
        const MILLISECONDS_PER_QUARTER: u64 = 1000 * 3600 * 24 * 9000 / 100;
        // 1 quarter = (90d * 24h * 3600s * 1000ms) / (millisecs_in_era = block_time * blocks_num_in_era)
        let quarter_in_eras = MILLISECONDS_PER_QUARTER / MILLISECS_PER_BLOCK / (EPOCH_DURATION_IN_BLOCKS * T::SessionsPerEra::get()) as u64;
        let quarter_num = active_era.saturating_sub(Self::start_reward_era()) as u64 / quarter_in_eras;
        for _ in 0..quarter_num {
            maybe_rewards_this_quarter = maybe_rewards_this_quarter / 2;
        }
        let reward_this_era = maybe_rewards_this_quarter / quarter_in_eras as u128;
        reward_this_era.try_into().ok().unwrap()
    }
fn authoring_rewards_in_era ( active_era : EraIndex ) -> BalanceOf < T > { // TODO: Enable this in the main net // // Milliseconds per year for the Julian year (365.25 days). // const MILLISECONDS_PER_YEAR: u64 = 1000 * 3600 * 24 * 36525 / 100; // // Initial with total rewards per year // let year_in_eras = MILLISECONDS_PER_YEAR / MILLISECS_PER_BLOCK / (EPOCH_DURATION_IN_BLOCKS * T::SessionsPerEra::get()) as u64; // // let reward_this_era = BLOCK_AUTHORING_REWARDS / year_in_eras as u128; // // reward_this_era.try_into().ok().unwrap() let mut maybe_rewards_this_quarter = FIRST_QUARTER_AUTHORING_REWARDS ; const MILLISECONDS_PER_QUARTER : u64 = 1000 * 3600 * 24 * 9000 / 100 ; // 1 quarter = (90d * 24h * 3600s * 1000ms) / (millisecs_in_era = block_time * blocks_num_in_era) let quarter_in_eras = MILLISECONDS_PER_QUARTER / MILLISECS_PER_BLOCK / ( EPOCH_DURATION_IN_BLOCKS * T :: SessionsPerEra :: get ( ) ) as u64 ; let quarter_num = active_era . saturating_sub ( Self :: start_reward_era ( ) ) as u64 / quarter_in_eras ; for _ in 0 .. quarter_num { maybe_rewards_this_quarter = maybe_rewards_this_quarter / 2 ; } let reward_this_era = maybe_rewards_this_quarter / quarter_in_eras as u128 ; reward_this_era . try_into ( ) . ok ( ) . unwrap ( ) }
Block authoring rewards per era, this won't be changed in every era
Block authoring rewards per era this won ' t be changed in every era
active_era
EraIndex