diff --git a/x/harvest/keeper/borrow.go b/x/harvest/keeper/borrow.go index dfdead7c..7eaa9e9b 100644 --- a/x/harvest/keeper/borrow.go +++ b/x/harvest/keeper/borrow.go @@ -222,7 +222,7 @@ func (k Keeper) ValidateBorrow(ctx sdk.Context, borrower sdk.AccAddress, amount // Validate that the proposed borrow's USD value is within user's borrowable limit if proprosedBorrowUSDValue.GT(totalBorrowableAmount.Sub(existingBorrowUSDValue)) { - return sdkerrors.Wrapf(types.ErrInsufficientLoanToValue, "requested borrow %s is greater than maximum valid borrow", amount) + return sdkerrors.Wrapf(types.ErrInsufficientLoanToValue, "requested borrow %s exceeds the allowable amount as determined by the collateralization ratio", amount) } return nil } diff --git a/x/harvest/keeper/borrow_test.go b/x/harvest/keeper/borrow_test.go index 1a9bc8ad..45b03935 100644 --- a/x/harvest/keeper/borrow_test.go +++ b/x/harvest/keeper/borrow_test.go @@ -89,7 +89,7 @@ func (suite *KeeperTestSuite) TestBorrow() { }, errArgs{ expectPass: false, - contains: "total deposited value is insufficient for borrow request", + contains: "exceeds the allowable amount as determined by the collateralization ratio", }, }, { @@ -131,7 +131,7 @@ func (suite *KeeperTestSuite) TestBorrow() { }, errArgs{ expectPass: false, - contains: "total deposited value is insufficient for borrow request", + contains: "exceeds the allowable amount as determined by the collateralization ratio", }, }, { @@ -175,7 +175,7 @@ func (suite *KeeperTestSuite) TestBorrow() { }, errArgs{ expectPass: false, - contains: "requested borrow 1000000usdx is greater than maximum valid borrow", + contains: "exceeds the allowable amount as determined by the collateralization ratio", }, }, { diff --git a/x/harvest/types/errors.go b/x/harvest/types/errors.go index 5906ed2f..f6edf94a 100644 --- a/x/harvest/types/errors.go +++ b/x/harvest/types/errors.go @@ -40,7 +40,7 @@ var ( // ErrDepositsNotFound error for no deposits found ErrDepositsNotFound = sdkerrors.Register(ModuleName, 17, "no deposits found") // ErrInsufficientLoanToValue error for when an attempted borrow exceeds maximum loan-to-value - ErrInsufficientLoanToValue = sdkerrors.Register(ModuleName, 18, "total deposited value is insufficient for borrow request") + ErrInsufficientLoanToValue = sdkerrors.Register(ModuleName, 18, "not enough collateral supplied by account") // ErrMarketNotFound error for when a market for the input denom is not found ErrMarketNotFound = sdkerrors.Register(ModuleName, 19, "no market found for denom") // ErrPriceNotFound error for when a price for the input market is not found