Skip to content

Commit

Permalink
Disallow CreateValidator
Browse files Browse the repository at this point in the history
  • Loading branch information
cl9200 committed Oct 6, 2019
1 parent f6280e7 commit 664ac39
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 @@ -146,7 +146,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 664ac39

Please sign in to comment.