fn calc_final_stake<Balance>(&self, orig_stake: Balance) -> (Balance, Balance)
		where
			Balance: sp_runtime::traits::AtLeast32BitUnsigned + Copy + FixedPointConvert,
		{
			// Calcualte remaining stake
			let v = FixedPoint::from_bits(self.v);
			let ve = FixedPoint::from_bits(self.ve);
			let return_rate = (v / ve).min(fp!(1));
			// If we consider kappa as a panelty of frequent exit:
			// 	let tokenomic = Self::tokenomic();
			// 	let returned = return_rate * orig_stake.to_fixed() * tokenomic.kappa();
			let returned = return_rate * orig_stake.to_fixed();
			// Convert to Balance
			let returned = FixedPointConvert::from_fixed(&returned);
			let slashed = orig_stake - returned;
			(returned, slashed)
		}
/// Calculates the final final returned and slashed stake
Calculates the final final returned and slashed stake
Calculates the final final returned and slashed stake
fn calc_final_stake<Balance>(&self, orig_stake: Balance) -> (Balance, Balance)
		where
			Balance: sp_runtime::traits::AtLeast32BitUnsigned + Copy + FixedPointConvert,
		{
			// Calcualte remaining stake
			let v = FixedPoint::from_bits(self.v);
			let ve = FixedPoint::from_bits(self.ve);
			let return_rate = (v / ve).min(fp!(1));
			// If we consider kappa as a panelty of frequent exit:
			// 	let tokenomic = Self::tokenomic();
			// 	let returned = return_rate * orig_stake.to_fixed() * tokenomic.kappa();
			let returned = return_rate * orig_stake.to_fixed();
			// Convert to Balance
			let returned = FixedPointConvert::from_fixed(&returned);
			let slashed = orig_stake - returned;
			(returned, slashed)
		}
fn calc_final_stake < Balance > ( & self , orig_stake : Balance ) -> ( Balance , Balance ) where Balance : sp_runtime :: traits :: AtLeast32BitUnsigned + Copy + FixedPointConvert , { // Calcualte remaining stake let v = FixedPoint :: from_bits ( self . v ) ; let ve = FixedPoint :: from_bits ( self . ve ) ; let return_rate = ( v / ve ) . min ( fp ! ( 1 ) ) ; // If we consider kappa as a panelty of frequent exit: // 	let tokenomic = Self::tokenomic(); // 	let returned = return_rate * orig_stake.to_fixed() * tokenomic.kappa(); let returned = return_rate * orig_stake . to_fixed ( ) ; // Convert to Balance let returned = FixedPointConvert :: from_fixed ( & returned ) ; let slashed = orig_stake - returned ; ( returned , slashed ) }
Calculates the final final returned and slashed stake
Calculates the final final returned and slashed stake
&self
orig_stake
Balance
&self
orig_stake
Balance