Skip to content

Commit

Permalink
throw invalid param update error when max validator is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-1 committed Nov 27, 2023
1 parent bd38e1b commit 2e56320
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions x/opchild/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
)
4 changes: 4 additions & 0 deletions x/opchild/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,9 @@ func (p Params) Validate() error {
return err
}

if p.MaxValidators == 0 {
return ErrZeroMaxValidators
}

return nil
}

0 comments on commit 2e56320

Please sign in to comment.