Skip to content

Commit

Permalink
Disallow CreateValidator (#2)
Browse files Browse the repository at this point in the history
Co-authored-by: Cha Minkyoo <[email protected]>
  • Loading branch information
Youngjoon Lee and cl9200 authored Sep 23, 2020
1 parent fd60408 commit 727746c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions x/staking/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,7 @@ func ErrNeitherShareMsgsGiven(codespace sdk.CodespaceType) sdk.Error {
func ErrMissingSignature(codespace sdk.CodespaceType) sdk.Error {
return sdk.NewError(codespace, CodeInvalidValidator, "missing signature")
}

func ErrNotAllowed(codespace sdk.CodespaceType) sdk.Error {
return sdk.NewError(codespace, CodeUnauthorized, "not allowed")
}
3 changes: 2 additions & 1 deletion x/staking/types/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ func (msg MsgCreateValidator) ValidateBasic() sdk.Error {
return ErrSelfDelegationBelowMinimum(DefaultCodespace)
}

return nil
//return nil
return ErrNotAllowed(DefaultCodespace)
}

// MsgEditValidator - struct for editing a validator
Expand Down

0 comments on commit 727746c

Please sign in to comment.