Check self-delegation against provided minimum
This commit is contained in:
parent
abbed8593e
commit
443c6c1f7a
|
@ -160,6 +160,10 @@ func (k msgServer) EditValidator(goCtx context.Context, msg *types.MsgEditValida
|
|||
return nil, types.ErrMinSelfDelegationDecreased
|
||||
}
|
||||
|
||||
if msg.MinSelfDelegation.GT(validator.Tokens) {
|
||||
return nil, types.ErrSelfDelegationBelowMinimum
|
||||
}
|
||||
|
||||
validator.MinSelfDelegation = (*msg.MinSelfDelegation)
|
||||
}
|
||||
|
||||
|
|
|
@ -129,6 +129,10 @@ func (msg MsgCreateValidator) ValidateBasic() error {
|
|||
return err
|
||||
}
|
||||
|
||||
if !msg.Value.Amount.GTE(msg.MinSelfDelegation) {
|
||||
return ErrSelfDelegationBelowMinimum
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue