pub fn stake_limit_of(own_workloads: u128, _: u128) -> BalanceOf<T> {
        // TODO: Stake limit calculation, this should be enable and adjust in olympus phase.
        /*let total_issuance = TryInto::<u128>::try_into(T::Currency::total_issuance())
            .ok()
            .unwrap();

        // total_workloads cannot be zero, or system go panic!
        if total_workloads == 0 {
            Zero::zero()
        } else {
            let workloads_to_stakes = (( own_workloads.wrapping_mul(total_issuance) / total_workloads / 2) as u128)
                .min(u64::max_value() as u128);

            workloads_to_stakes.try_into().ok().unwrap()
        }*/

        // Now, we apply directly mapping algorithm for the early stage:
        // 1. Maxwell 1.0: 1 terabytes -> 80,000 CALs
        // 2. Olympus 1.0: 1 terabytes -> 30 CALs(tmp)
        // ps: we treat 1 terabytes as 1_000_000_000_000 for make `mapping_ratio = 1`
        if let Some(storage_stakes) = own_workloads.checked_mul(T::SPowerRatio::get()) {
            storage_stakes.try_into().ok().unwrap()
        } else {
            (u64::max_value() as u128).try_into().ok().unwrap()
        }
    }
/// Calculate the stake limit by storage workloads, returns the stake limit value
///
/// # <weight>
/// - Independent of the arguments. Insignificant complexity.
/// - O(1).
/// - 0 DB entry.
/// # </weight>
Calculate the stake limit by storage workloads, returns the stake limit value
Calculate the stake limit by storage workloads returns the stake limit value
pub fn stake_limit_of(own_workloads: u128, _: u128) -> BalanceOf<T> {
        // TODO: Stake limit calculation, this should be enable and adjust in olympus phase.
        /*let total_issuance = TryInto::<u128>::try_into(T::Currency::total_issuance())
            .ok()
            .unwrap();
        // total_workloads cannot be zero, or system go panic!
        if total_workloads == 0 {
            Zero::zero()
        } else {
            let workloads_to_stakes = (( own_workloads.wrapping_mul(total_issuance) / total_workloads / 2) as u128)
                .min(u64::max_value() as u128);
            workloads_to_stakes.try_into().ok().unwrap()
        }*/
        // Now, we apply directly mapping algorithm for the early stage:
        // 1. Maxwell 1.0: 1 terabytes -> 80,000 CALs
        // 2. Olympus 1.0: 1 terabytes -> 30 CALs(tmp)
        // ps: we treat 1 terabytes as 1_000_000_000_000 for make `mapping_ratio = 1`
        if let Some(storage_stakes) = own_workloads.checked_mul(T::SPowerRatio::get()) {
            storage_stakes.try_into().ok().unwrap()
        } else {
            (u64::max_value() as u128).try_into().ok().unwrap()
        }
    }
pub fn stake_limit_of ( own_workloads : u128 , _ : u128 ) -> BalanceOf < T > { // TODO: Stake limit calculation, this should be enable and adjust in olympus phase. /*let total_issuance = TryInto::<u128>::try_into(T::Currency::total_issuance())
            .ok()
            .unwrap();

        // total_workloads cannot be zero, or system go panic!
        if total_workloads == 0 {
            Zero::zero()
        } else {
            let workloads_to_stakes = (( own_workloads.wrapping_mul(total_issuance) / total_workloads / 2) as u128)
                .min(u64::max_value() as u128);

            workloads_to_stakes.try_into().ok().unwrap()
        }*/ // Now, we apply directly mapping algorithm for the early stage: // 1. Maxwell 1.0: 1 terabytes -> 80,000 CALs // 2. Olympus 1.0: 1 terabytes -> 30 CALs(tmp) // ps: we treat 1 terabytes as 1_000_000_000_000 for make `mapping_ratio = 1` if let Some ( storage_stakes ) = own_workloads . checked_mul ( T :: SPowerRatio :: get ( ) ) { storage_stakes . try_into ( ) . ok ( ) . unwrap ( ) } else { ( u64 :: max_value ( ) as u128 ) . try_into ( ) . ok ( ) . unwrap ( ) } }
Calculate the stake limit by storage workloads, returns the stake limit value
Calculate the stake limit by storage workloads returns the stake limit value
own_workloads
u128
<weight>
Independent of the arguments. Insignificant complexity.
O(1).
0 DB entry.
Independent of the arguments . Insignificant complexity . O ( 1 ) . 0 DB entry .
</weight>
None