mirror of
				https://github.com/0glabs/0g-chain.git
				synced 2025-11-04 15:27:27 +00:00 
			
		
		
		
	update ltv error msg (#733)
This commit is contained in:
		
							parent
							
								
									068e12380e
								
							
						
					
					
						commit
						2442d281ab
					
				@ -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
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -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",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user