/// Update the pending reward when the amount staked changes.
Update the pending reward when the amount staked changes.
Update the pending reward when the amount staked changes .
pub fn pay_out(&mut self, new_stake: u64, reward_per_share: u128) {
        let pending = self.calculate_holding(reward_per_share) - self.reward_debt;
        self.staked = new_stake;
        self.reward_debt = self.calculate_holding(reward_per_share);
        self.holding += pending;
    }
pub fn pay_out ( & mut self , new_stake : u64 , reward_per_share : u128 ) { let pending = self . calculate_holding ( reward_per_share ) - self . reward_debt ; self . staked = new_stake ; self . reward_debt = self . calculate_holding ( reward_per_share ) ; self . holding += pending ; }
Update the pending reward when the amount staked changes.
Update the pending reward when the amount staked changes .
&mut self
new_stake
u64
reward_per_share
u128