pub(crate) fn view_farmer_unclaimed_reward(
        &self,
        user_rps: &RPS,
        user_seeds: &Balance,
        total_seeds: &Balance,
    ) -> Balance {
        if total_seeds == &0 {
            return 0;
        }
        if user_seeds == &0 {
            return 0;
        }
        if let Some(dis) = self.try_distribute(total_seeds) {
            (U256::from(*user_seeds) 
            * (U256::from_little_endian(&dis.rps) - U256::from_little_endian(user_rps))
            / U256::from(DENOM)).as_u128()
        } else {
            (U256::from(*user_seeds) 
            * (U256::from_little_endian(&self.last_distribution.rps) - U256::from_little_endian(user_rps))
            / U256::from(DENOM)).as_u128()
        }
    }
/// Return how many reward token that the user hasn't claimed yet.
/// return (cur_rps - last_user_rps) * user_seeds / DENOM
Return how many reward token that the user hasn't claimed yet.
Return how many reward token that the user hasn ' t claimed yet .
pub(crate) fn view_farmer_unclaimed_reward(
        &self,
        user_rps: &RPS,
        user_seeds: &Balance,
        total_seeds: &Balance,
    ) -> Balance {
        if total_seeds == &0 {
            return 0;
        }
        if user_seeds == &0 {
            return 0;
        }
        if let Some(dis) = self.try_distribute(total_seeds) {
            (U256::from(*user_seeds) 
            * (U256::from_little_endian(&dis.rps) - U256::from_little_endian(user_rps))
            / U256::from(DENOM)).as_u128()
        } else {
            (U256::from(*user_seeds) 
            * (U256::from_little_endian(&self.last_distribution.rps) - U256::from_little_endian(user_rps))
            / U256::from(DENOM)).as_u128()
        }
    }
pub ( crate ) fn view_farmer_unclaimed_reward ( & self , user_rps : & RPS , user_seeds : & Balance , total_seeds : & Balance , ) -> Balance { if total_seeds == & 0 { return 0 ; } if user_seeds == & 0 { return 0 ; } if let Some ( dis ) = self . try_distribute ( total_seeds ) { ( U256 :: from ( * user_seeds ) * ( U256 :: from_little_endian ( & dis . rps ) - U256 :: from_little_endian ( user_rps ) ) / U256 :: from ( DENOM ) ) . as_u128 ( ) } else { ( U256 :: from ( * user_seeds ) * ( U256 :: from_little_endian ( & self . last_distribution . rps ) - U256 :: from_little_endian ( user_rps ) ) / U256 :: from ( DENOM ) ) . as_u128 ( ) } }
Return how many reward token that the user hasn't claimed yet.
Return how many reward token that the user hasn ' t claimed yet .
&self
user_rps
&RPS
user_seeds
&Balance
total_seeds
&Balance
&self
user_rps
&RPS
user_seeds
&Balance
total_seeds
&Balance