fn do_repay(
		who: &T::AccountId,
		borrower: &T::AccountId,
		underlying_asset: CurrencyId,
		mut repay_amount: Balance,
		all_assets: bool,
	) -> BalanceResult {
		ensure!(
			underlying_asset.is_supported_underlying_asset(),
			Error::<T>::NotValidUnderlyingAssetId
		);
		ensure!(
			T::ManagerLiquidityPools::pool_exists(&underlying_asset),
			liquidity_pools::Error::<T>::PoolNotFound
		);

		T::ControllerManager::accrue_interest_rate(underlying_asset).map_err(|_| Error::<T>::AccrueInterestFailed)?;
		repay_amount = Self::do_repay_fresh(who, borrower, underlying_asset, repay_amount, all_assets)?;
		Ok(repay_amount)
	}
/// Sender repays their own borrow
///
/// - `who`: the account paying off the borrow.
/// - `borrower`: the account with the debt being payed off.
/// - `underlying_asset`: the currency ID of the underlying asset to repay.
/// - `repay_amount`: the amount of the underlying asset to repay.
Sender repays their own borrow
`who`: the account paying off the borrow.
`borrower`: the account with the debt being payed off.
`underlying_asset`: the currency ID of the underlying asset to repay.
`repay_amount`: the amount of the underlying asset to repay.
Sender repays their own borrow ` who ` : the account paying off the borrow . ` borrower ` : the account with the debt being payed off . ` underlying_asset ` : the currency ID of the underlying asset to repay . ` repay_amount ` : the amount of the underlying asset to repay .
fn do_repay(
		who: &T::AccountId,
		borrower: &T::AccountId,
		underlying_asset: CurrencyId,
		mut repay_amount: Balance,
		all_assets: bool,
	) -> BalanceResult {
		ensure!(
			underlying_asset.is_supported_underlying_asset(),
			Error::<T>::NotValidUnderlyingAssetId
		);
		ensure!(
			T::ManagerLiquidityPools::pool_exists(&underlying_asset),
			liquidity_pools::Error::<T>::PoolNotFound
		);
		T::ControllerManager::accrue_interest_rate(underlying_asset).map_err(|_| Error::<T>::AccrueInterestFailed)?;
		repay_amount = Self::do_repay_fresh(who, borrower, underlying_asset, repay_amount, all_assets)?;
		Ok(repay_amount)
	}
fn do_repay ( who : & T :: AccountId , borrower : & T :: AccountId , underlying_asset : CurrencyId , mut repay_amount : Balance , all_assets : bool , ) -> BalanceResult { ensure ! ( underlying_asset is_supported_underlying_asset ( ) Error T NotValidUnderlyingAssetId ) ; ensure ! ( T ManagerLiquidityPools pool_exists ( underlying_asset ) liquidity_pools Error T PoolNotFound ) ; T :: ControllerManager :: accrue_interest_rate ( underlying_asset ) . map_err ( | _ | Error :: < T > :: AccrueInterestFailed ) ? ; repay_amount = Self :: do_repay_fresh ( who , borrower , underlying_asset , repay_amount , all_assets ) ? ; Ok ( repay_amount ) }
Sender repays their own borrow
 `who`: the account paying off the borrow.
Sender repays their own borrow ` who ` : the account paying off the borrow .
who
&T::AccountId
borrower
&T::AccountId
underlying_asset
CurrencyId
repay_amount
Balance
all_assets
bool
who
&T::AccountId
borrower
&T::AccountId
underlying_asset
CurrencyId
repay_amount
Balance
all_assets
bool