diff --git a/x/opchild/types/errors.go b/x/opchild/types/errors.go index 3135eb10..a1efba47 100644 --- a/x/opchild/types/errors.go +++ b/x/opchild/types/errors.go @@ -16,4 +16,5 @@ var ( ErrDepositAlreadyFinalized = errorsmod.Register(ModuleName, 9, "deposit already finalized") ErrInvalidAmount = errorsmod.Register(ModuleName, 10, "invalid amount") ErrInvalidSequence = errorsmod.Register(ModuleName, 11, "invalid sequence") + ErrZeroMaxValidators = errorsmod.Register(ModuleName, 12, "max validators must be non-zero") ) diff --git a/x/opchild/types/params.go b/x/opchild/types/params.go index 1c405946..cc14edd0 100644 --- a/x/opchild/types/params.go +++ b/x/opchild/types/params.go @@ -48,5 +48,9 @@ func (p Params) Validate() error { return err } + if p.MaxValidators == 0 { + return ErrZeroMaxValidators + } + return nil }