From 2442d281ab685061da01640f69cb81c111c536bd Mon Sep 17 00:00:00 2001 From: Denali Marsh Date: Tue, 8 Dec 2020 14:28:01 +0100 Subject: [PATCH] update ltv error msg (#733) --- x/harvest/keeper/borrow.go | 2 +- x/harvest/keeper/borrow_test.go | 6 +++--- x/harvest/types/errors.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) 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