update ltv error msg (#733)

This commit is contained in:
Denali Marsh 2020-12-08 14:28:01 +01:00 committed by GitHub
parent 068e12380e
commit 2442d281ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -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 // Validate that the proposed borrow's USD value is within user's borrowable limit
if proprosedBorrowUSDValue.GT(totalBorrowableAmount.Sub(existingBorrowUSDValue)) { 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 return nil
} }

View File

@ -89,7 +89,7 @@ func (suite *KeeperTestSuite) TestBorrow() {
}, },
errArgs{ errArgs{
expectPass: false, 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{ errArgs{
expectPass: false, 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{ errArgs{
expectPass: false, expectPass: false,
contains: "requested borrow 1000000usdx is greater than maximum valid borrow", contains: "exceeds the allowable amount as determined by the collateralization ratio",
}, },
}, },
{ {

View File

@ -40,7 +40,7 @@ var (
// ErrDepositsNotFound error for no deposits found // ErrDepositsNotFound error for no deposits found
ErrDepositsNotFound = sdkerrors.Register(ModuleName, 17, "no deposits found") ErrDepositsNotFound = sdkerrors.Register(ModuleName, 17, "no deposits found")
// ErrInsufficientLoanToValue error for when an attempted borrow exceeds maximum loan-to-value // 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 error for when a market for the input denom is not found
ErrMarketNotFound = sdkerrors.Register(ModuleName, 19, "no market found for denom") ErrMarketNotFound = sdkerrors.Register(ModuleName, 19, "no market found for denom")
// ErrPriceNotFound error for when a price for the input market is not found // ErrPriceNotFound error for when a price for the input market is not found