pub fn reclaim(miner: T::AccountId) -> Result<(BalanceOf<T>, BalanceOf<T>), DispatchError> {
			let mut miner_info = Miners::<T>::get(&miner).ok_or(Error::<T>::MinerNotFound)?;
			ensure!(Self::can_reclaim(&miner_info), Error::<T>::CoolDownNotReady);
			miner_info.state = MinerState::Ready;
			miner_info.cool_down_start = 0u64;
			Miners::<T>::insert(&miner, &miner_info);

			let orig_stake = Stakes::<T>::take(&miner).unwrap_or_default();
			let (_returned, slashed) = miner_info.calc_final_stake(orig_stake);

			Self::deposit_event(Event::<T>::MinerReclaimed(miner, orig_stake, slashed));
			Ok((orig_stake, slashed))
		}
/// Turns the miner back to Ready state after cooling down and trigger stake releasing.
///
/// Requires:
/// 1. Ther miner is in CoolingDown state and the cool down period has passed
Turns the miner back to Ready state after cooling down and trigger stake releasing.
Requires:
1. Ther miner is in CoolingDown state and the cool down period has passed
Turns the miner back to Ready state after cooling down and trigger stake releasing . Requires : 1 . Ther miner is in CoolingDown state and the cool down period has passed
pub fn reclaim(miner: T::AccountId) -> Result<(BalanceOf<T>, BalanceOf<T>), DispatchError> {
			let mut miner_info = Miners::<T>::get(&miner).ok_or(Error::<T>::MinerNotFound)?;
			ensure!(Self::can_reclaim(&miner_info), Error::<T>::CoolDownNotReady);
			miner_info.state = MinerState::Ready;
			miner_info.cool_down_start = 0u64;
			Miners::<T>::insert(&miner, &miner_info);
			let orig_stake = Stakes::<T>::take(&miner).unwrap_or_default();
			let (_returned, slashed) = miner_info.calc_final_stake(orig_stake);
			Self::deposit_event(Event::<T>::MinerReclaimed(miner, orig_stake, slashed));
			Ok((orig_stake, slashed))
		}
pub fn reclaim ( miner : T :: AccountId ) -> Result < ( BalanceOf < T > , BalanceOf < T > ) , DispatchError > { let mut miner_info = Miners :: < T > :: get ( & miner ) . ok_or ( Error :: < T > :: MinerNotFound ) ? ; ensure ! ( Self can_reclaim ( miner_info ) Error T CoolDownNotReady ) ; miner_info . state = MinerState :: Ready ; miner_info . cool_down_start = 0u64 ; Miners :: < T > :: insert ( & miner , & miner_info ) ; let orig_stake = Stakes :: < T > :: take ( & miner ) . unwrap_or_default ( ) ; let ( _returned , slashed ) = miner_info . calc_final_stake ( orig_stake ) ; Self :: deposit_event ( Event :: < T > :: MinerReclaimed ( miner , orig_stake , slashed ) ) ; Ok ( ( orig_stake , slashed ) ) }
Turns the miner back to Ready state after cooling down and trigger stake releasing.
Turns the miner back to Ready state after cooling down and trigger stake releasing .
miner
T::AccountId
miner
T::AccountId