fix: allow ltv of zero (#830)

This commit is contained in:
Kevin Davis 2021-02-16 07:43:46 -07:00 committed by GitHub
parent ad6ef76979
commit 58573e7b26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,8 +51,8 @@ func (bl BorrowLimit) Validate() error {
if bl.MaximumLimit.IsNegative() {
return fmt.Errorf("maximum limit USD cannot be negative: %s", bl.MaximumLimit)
}
if !bl.LoanToValue.IsPositive() {
return fmt.Errorf("loan-to-value must be a positive integer: %s", bl.LoanToValue)
if bl.LoanToValue.IsNegative() {
return fmt.Errorf("loan-to-value must be a non-negative decimal: %s", bl.LoanToValue)
}
if bl.LoanToValue.GT(sdk.OneDec()) {
return fmt.Errorf("loan-to-value cannot be greater than 1.0: %s", bl.LoanToValue)