From facb357fe952a96ca85092fe6ff0b65b9ebccf01 Mon Sep 17 00:00:00 2001 From: Denali Marsh Date: Thu, 4 Feb 2021 17:53:50 +0100 Subject: [PATCH] return err in ValidateBorrow (#799) --- x/hard/keeper/borrow.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/hard/keeper/borrow.go b/x/hard/keeper/borrow.go index ee200db7..ebb7fc3e 100644 --- a/x/hard/keeper/borrow.go +++ b/x/hard/keeper/borrow.go @@ -193,7 +193,7 @@ func (k Keeper) ValidateBorrow(ctx sdk.Context, borrower sdk.AccAddress, amount // Calculate the borrowable amount and add it to the user's total borrowable amount assetPriceInfo, err := k.pricefeedKeeper.GetCurrentPrice(ctx, moneyMarket.SpotMarketID) if err != nil { - sdkerrors.Wrapf(types.ErrPriceNotFound, "no price found for market %s", moneyMarket.SpotMarketID) + return sdkerrors.Wrapf(types.ErrPriceNotFound, "no price found for market %s", moneyMarket.SpotMarketID) } depositUSDValue := sdk.NewDecFromInt(depCoin.Amount).Quo(sdk.NewDecFromInt(moneyMarket.ConversionFactor)).Mul(assetPriceInfo.Price) borrowableAmountForDeposit := depositUSDValue.Mul(moneyMarket.BorrowLimit.LoanToValue)