mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-24 15:25:18 +00:00
fix: allow ltv of zero (#830)
This commit is contained in:
parent
ad6ef76979
commit
58573e7b26
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user