Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Jul 22, 2024
1 parent 8062337 commit a0c00b2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 19 deletions.
2 changes: 0 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ issues:

linters-settings:
exclude: ./pystarport/*
govet:
check-shadowing: true
errcheck:
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
# default is false: such cases aren't reported by default.
Expand Down
3 changes: 1 addition & 2 deletions cmd/chain-maind/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"time"

clientcfg "github.com/cosmos/cosmos-sdk/client/config"
conf "github.com/cosmos/cosmos-sdk/client/config"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
serverconfig "github.com/cosmos/cosmos-sdk/server/config"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
Expand Down Expand Up @@ -85,7 +84,7 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
if err != nil {
return err
}
initClientCtx, err = conf.ReadFromClientConfig(initClientCtx)
initClientCtx, err = clientcfg.ReadFromClientConfig(initClientCtx)
if err != nil {
return err
}
Expand Down
7 changes: 1 addition & 6 deletions x/icaauth/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
"github.com/cosmos/gogoproto/proto"
capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper"
capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"
icacontrollerkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/keeper"
Expand Down Expand Up @@ -62,11 +61,7 @@ func (k *Keeper) DoSubmitTx(ctx sdk.Context, connectionID, owner string, msgs []
return err
}

protoMsgs := make([]proto.Message, len(msgs))
for i, msg := range msgs {
protoMsgs[i] = msg.(proto.Message)
}
data, err := icatypes.SerializeCosmosTx(k.cdc, protoMsgs, icatypes.EncodingProtobuf)
data, err := icatypes.SerializeCosmosTx(k.cdc, msgs, icatypes.EncodingProtobuf)
if err != nil {
return err
}
Expand Down
5 changes: 1 addition & 4 deletions x/nft-transfer/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@ import (
)

var (
amino = codec.NewLegacyAmino()
AminoCdc = codec.NewLegacyAmino()

// ModuleCdc references the global x/ibc-transfer module codec. Note, the codec
// should ONLY be used in certain instances of tests and for JSON encoding.
//
// The actual codec used for serialization should be provided to x/ibc transfer and
// defined at the application level.
ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry())

// AminoCdc is a amino codec created to support amino json compatible msgs.
AminoCdc = codec.NewAminoCodec(amino)
)

// RegisterLegacyAminoCodec registers the necessary nft-transfer interfaces and concrete types
Expand Down
9 changes: 4 additions & 5 deletions x/nft/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ import (
)

var (

Check failure on line 19 in x/nft/types/codec.go

View workflow job for this annotation

GitHub Actions / golangci-lint

File is not `gofumpt`-ed (gofumpt)
amino = codec.NewLegacyAmino()
ModuleCdc = codec.NewAminoCodec(amino)
ModuleCdc = codec.NewLegacyAmino()
)

func init() {
RegisterLegacyAminoCodec(amino)
cryptocodec.RegisterCrypto(amino)
amino.Seal()
RegisterLegacyAminoCodec(ModuleCdc)
cryptocodec.RegisterCrypto(ModuleCdc)
ModuleCdc.Seal()
}

// RegisterLegacyAminoCodec concrete types on codec
Expand Down

0 comments on commit a0c00b2

Please sign in to comment.