Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
Fix lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
misko9 committed Nov 6, 2023
1 parent 8dadf6b commit d72572f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion x/ism/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
sdkerrors "cosmossdk.io/errors"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"

"github.com/strangelove-ventures/hyperlane-cosmos/x/ism/types"
Expand Down
2 changes: 1 addition & 1 deletion x/ism/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package types
import (
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
sdkerrors "cosmossdk.io/errors"
"github.com/cosmos/cosmos-sdk/types/msgservice"
proto "github.com/cosmos/gogoproto/proto"
)
Expand Down
10 changes: 6 additions & 4 deletions x/mailbox/keeper/receivers.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import (
"encoding/json"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
errorsmod "cosmossdk.io/errors"

"github.com/strangelove-ventures/hyperlane-cosmos/x/mailbox/types"
)

type QueryMsg struct {
Expand Down Expand Up @@ -62,7 +64,7 @@ func (k Keeper) getReceiversIsm(ctx sdk.Context, recipient string) (uint32, erro
return ismResp.IsmId, nil
}

return 0, sdkerrors.ErrInvalidAddress
return 0, types.ErrInvalidRecipient
}

func (k Keeper) processMsg(ctx sdk.Context, recipient string, origin uint32, sender string, msg string) error {
Expand Down Expand Up @@ -91,7 +93,7 @@ func (k Keeper) processMsg(ctx sdk.Context, recipient string, origin uint32, sen

receiverAddr, err := sdk.AccAddressFromBech32(recipient)
if err != nil {
return sdkerrors.Wrap(err, "contract")
return errorsmod.Wrap(err, "invalid bech32 recipient")
}

// Call the recipient contract
Expand All @@ -103,5 +105,5 @@ func (k Keeper) processMsg(ctx sdk.Context, recipient string, origin uint32, sen
return nil
}

return sdkerrors.ErrInvalidAddress
return types.ErrInvalidRecipient
}
1 change: 1 addition & 0 deletions x/mailbox/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ var (
ErrMsgProcessInvalidSender = sdkerrors.Register(ModuleName, 12, "invalid sender in msg process")
ErrMsgProcessInvalidMetadata = sdkerrors.Register(ModuleName, 13, "invalid metadata in msg process")
ErrMsgProcessInvalidMessage = sdkerrors.Register(ModuleName, 14, "invalid message in msg process")
ErrInvalidRecipient = sdkerrors.Register(ModuleName, 15, "invalid recipient")
)

0 comments on commit d72572f

Please sign in to comment.