Skip to content

Commit

Permalink
fix(lint): handle error
Browse files Browse the repository at this point in the history
  • Loading branch information
bdeneux committed Mar 29, 2023
1 parent cc31dbd commit 8e28027
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
3 changes: 2 additions & 1 deletion x/logic/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ var _ types.MsgServiceServer = msgServer{}
// account.
func (ms msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) {
if ms.authority.String() != req.Authority {
return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.authority.String(), req.Authority)
return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner,
"invalid authority; expected %s, got %s", ms.authority.String(), req.Authority)
}

ctx := sdk.UnwrapSDKContext(goCtx)
Expand Down
6 changes: 5 additions & 1 deletion x/mint/keeper/genesis.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
package keeper

import (
errorsmod "cosmossdk.io/errors"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/okp4/okp4d/x/mint/types"
)

// InitGenesis new mint genesis.
func (k Keeper) InitGenesis(ctx sdk.Context, ak types.AccountKeeper, data *types.GenesisState) {
k.SetMinter(ctx, data.Minter)
k.SetParams(ctx, data.Params)
err := k.SetParams(ctx, data.Params)
if err != nil {
panic(errorsmod.Wrapf(err, "error setting params"))
}
ak.GetModuleAccount(ctx, types.ModuleName)
}

Expand Down
3 changes: 2 additions & 1 deletion x/mint/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ var _ types.MsgServiceServer = msgServer{}
// account.
func (ms msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) {
if ms.authority.String() != req.Authority {
return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.authority.String(), req.Authority)
return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner,
"invalid authority; expected %s, got %s", ms.authority.String(), req.Authority)
}

ctx := sdk.UnwrapSDKContext(goCtx)
Expand Down
4 changes: 2 additions & 2 deletions x/mint/migrations/v2/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ func MigrateStore(ctx sdk.Context,
store := ctx.KVStore(storeKey)

var params types.Params
legacySubspace.WithKeyTable(types.ParamKeyTable()).
GetParamSet(ctx, &params)
legacySubspace.WithKeyTable(types.ParamKeyTable()). //nolint:staticcheck
GetParamSet(ctx, &params)

if err := params.Validate(); err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions x/mint/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const (
updateParamsName = "okp4/mint/MsgUpdateParams"
)

// RegisterInterfaces register implementations
// RegisterInterfaces register implementations.
func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
registry.RegisterImplementations(
(*sdk.Msg)(nil),
Expand All @@ -39,7 +39,7 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
msgservice.RegisterMsgServiceDesc(registry, &_MsgService_serviceDesc)
}

// RegisterLegacyAminoCodec required for EIP-712
// RegisterLegacyAminoCodec required for EIP-712.
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
cdc.RegisterConcrete(&MsgUpdateParams{}, updateParamsName, nil)
}

0 comments on commit 8e28027

Please sign in to comment.