Skip to content

Commit

Permalink
refactor: replace some user defined errors with sdk ones
Browse files Browse the repository at this point in the history
  • Loading branch information
hacheigriega committed Aug 23, 2024
1 parent db666ed commit 64465c9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
2 changes: 1 addition & 1 deletion x/pubkey/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (m msgServer) AddKey(goCtx context.Context, msg *types.MsgAddKey) (*types.M
return nil, sdkerrors.ErrInvalidAddress.Wrapf("invalid validator address: %s", err)
}
if _, err := m.stakingKeeper.GetValidator(ctx, valAddr); err != nil {
return nil, types.ErrValidatorNotFound
return nil, sdkerrors.ErrNotFound.Wrapf("validator not found %s", msg.ValidatorAddr)
}

for _, indPubKey := range msg.IndexedPubKeys {
Expand Down
9 changes: 0 additions & 9 deletions x/pubkey/types/errors.go

This file was deleted.

2 changes: 1 addition & 1 deletion x/pubkey/types/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var (

func (m *MsgAddKey) Validate() error {
if m.ValidatorAddr == "" {
return ErrEmptyValue.Wrap("empty validator address")
return sdkerrors.ErrInvalidRequest.Wrap("empty validator address")
}

sort.Slice(m.IndexedPubKeys, func(i, j int) bool {
Expand Down

0 comments on commit 64465c9

Please sign in to comment.