fn borrow_allowed(underlying_asset: CurrencyId, who: &T::AccountId, borrow_amount: Balance) -> DispatchResult {
		let borrow_cap_reached = Self::is_borrow_cap_reached(underlying_asset, borrow_amount)?;
		ensure!(!borrow_cap_reached, Error::<T>::BorrowCapReached);

		let (_, shortfall) = Self::get_hypothetical_account_liquidity(&who, underlying_asset, 0, borrow_amount)
			.map_err(|_| Error::<T>::HypotheticalLiquidityCalculationError)?;

		ensure!(shortfall.is_zero(), Error::<T>::InsufficientLiquidity);

		Ok(())
	}
/// Checks if the account should be allowed to borrow the underlying asset of the given pool.
///
/// - `underlying_asset` - The CurrencyId to verify the borrow against.
/// - `who` -  The account which would borrow the asset.
/// - `borrow_amount` - The amount of underlying assets the account would borrow.
///
/// Return Ok if the borrow is allowed.
Checks if the account should be allowed to borrow the underlying asset of the given pool.
`underlying_asset` - The CurrencyId to verify the borrow against.
`who` -  The account which would borrow the asset.
`borrow_amount` - The amount of underlying assets the account would borrow.

Return Ok if the borrow is allowed.
Checks if the account should be allowed to borrow the underlying asset of the given pool . ` underlying_asset ` - The CurrencyId to verify the borrow against . ` who ` - The account which would borrow the asset . ` borrow_amount ` - The amount of underlying assets the account would borrow . Return Ok if the borrow is allowed .
fn borrow_allowed(underlying_asset: CurrencyId, who: &T::AccountId, borrow_amount: Balance) -> DispatchResult {
		let borrow_cap_reached = Self::is_borrow_cap_reached(underlying_asset, borrow_amount)?;
		ensure!(!borrow_cap_reached, Error::<T>::BorrowCapReached);
		let (_, shortfall) = Self::get_hypothetical_account_liquidity(&who, underlying_asset, 0, borrow_amount)
			.map_err(|_| Error::<T>::HypotheticalLiquidityCalculationError)?;
		ensure!(shortfall.is_zero(), Error::<T>::InsufficientLiquidity);
		Ok(())
	}
fn borrow_allowed ( underlying_asset : CurrencyId , who : & T :: AccountId , borrow_amount : Balance ) -> DispatchResult { let borrow_cap_reached = Self :: is_borrow_cap_reached ( underlying_asset , borrow_amount ) ? ; ensure ! ( borrow_cap_reached Error T BorrowCapReached ) ; let ( _ , shortfall ) = Self :: get_hypothetical_account_liquidity ( & who , underlying_asset , 0 , borrow_amount ) . map_err ( | _ | Error :: < T > :: HypotheticalLiquidityCalculationError ) ? ; ensure ! ( shortfall is_zero ( ) Error T InsufficientLiquidity ) ; Ok ( ( ) ) }
Checks if the account should be allowed to borrow the underlying asset of the given pool.
Checks if the account should be allowed to borrow the underlying asset of the given pool .
underlying_asset
CurrencyId
who
&T::AccountId
borrow_amount
Balance
underlying_asset
CurrencyId
who
&T::AccountId
borrow_amount
Balance