From 1b2320c28fa88b32bdb9f010fc5f829c62f32465 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Fri, 3 Jun 2022 16:14:37 +0700 Subject: [PATCH 1/5] var-naming linter errors and a fumpt --- baseapp/baseapp_test.go | 1 - client/cmd.go | 2 +- client/grpc/tmservice/block.go | 4 +- client/grpc_query.go | 2 +- core/appconfig/config.go | 1 - crypto/keyring/keyring_test.go | 2 +- .../secp256k1/internal/secp256k1/curve.go | 8 +- depinject/debug.go | 2 +- pruning/manager.go | 2 +- runtime/module.go | 3 +- server/mock/tx.go | 6 +- server/tm_cmds.go | 2 - simapp/app.go | 7 +- simapp/test_helpers.go | 5 +- snapshots/types/util.go | 2 +- store/streaming/constructor_test.go | 1 - store/v2alpha1/smt/ics23.go | 2 +- types/coin.go | 2 +- types/kv/list.go | 2 +- x/auth/ante/ante_test.go | 1 - x/auth/ante/basic_test.go | 2 - x/auth/ante/setup.go | 4 +- x/auth/ante/sigverify.go | 1 - x/auth/module.go | 4 +- x/auth/tx/builder.go | 10 +- x/auth/tx/service.go | 4 +- x/authz/keeper/keeper.go | 8 +- x/authz/module/abci.go | 2 +- x/bank/module.go | 5 +- x/gov/keeper/msg_server.go | 2 +- x/gov/keeper/querier.go | 6 - x/gov/migrations/v046/convert.go | 2 +- x/gov/types/v1beta1/proposals_test.go | 1 - x/group/client/testutil/tx.go | 19 +-- x/group/keeper/grpc_query.go | 4 +- x/group/keeper/keeper.go | 6 +- x/group/keeper/keeper_test.go | 1 - x/group/keeper/msg_server.go | 10 +- x/group/keeper/tally.go | 4 +- x/nft/client/testutil/grpc.go | 160 +++++++++--------- x/params/module.go | 1 - 41 files changed, 140 insertions(+), 173 deletions(-) diff --git a/baseapp/baseapp_test.go b/baseapp/baseapp_test.go index 8d67a7a5f00..5be9331b626 100644 --- a/baseapp/baseapp_test.go +++ b/baseapp/baseapp_test.go @@ -1294,7 +1294,6 @@ func TestTxGasLimits(t *testing.T) { return newCtx, nil }) - } routerOpt := func(bapp *BaseApp) { diff --git a/client/cmd.go b/client/cmd.go index ce6faba09e0..77b404bcb57 100644 --- a/client/cmd.go +++ b/client/cmd.go @@ -268,7 +268,7 @@ func readTxCommandFlags(clientCtx Context, flagSet *pflag.FlagSet) (Context, err isAux, _ := flagSet.GetBool(flags.FlagAux) clientCtx = clientCtx.WithAux(isAux) if isAux { - // If the user didn't explicity set an --output flag, use JSON by + // If the user didn't explicitly set an --output flag, use JSON by // default. if clientCtx.OutputFormat == "" || !flagSet.Changed(cli.OutputFlag) { clientCtx = clientCtx.WithOutputFormat("json") diff --git a/client/grpc/tmservice/block.go b/client/grpc/tmservice/block.go index 6f3b1e55699..f941c9093a8 100644 --- a/client/grpc/tmservice/block.go +++ b/client/grpc/tmservice/block.go @@ -27,7 +27,7 @@ func GetProtoBlock(ctx context.Context, clientCtx client.Context, height *int64) if err != nil { return tmproto.BlockID{}, nil, err } - protoBlockId := block.BlockID.ToProto() + protoBlockID := block.BlockID.ToProto() - return protoBlockId, protoBlock, nil + return protoBlockID, protoBlock, nil } diff --git a/client/grpc_query.go b/client/grpc_query.go index dd0f5ab1133..a5b348ca105 100644 --- a/client/grpc_query.go +++ b/client/grpc_query.go @@ -156,7 +156,7 @@ func (f failingInterfaceRegistry) UnpackAny(any *types.Any, iface interface{}) e return errCodecNotSet } -func (f failingInterfaceRegistry) Resolve(typeUrl string) (proto.Message, error) { +func (f failingInterfaceRegistry) Resolve(typeURL string) (proto.Message, error) { return nil, errCodecNotSet } diff --git a/core/appconfig/config.go b/core/appconfig/config.go index b77330bb444..6aabcfcec95 100644 --- a/core/appconfig/config.go +++ b/core/appconfig/config.go @@ -80,7 +80,6 @@ func Compose(appConfig *appv1alpha1.Config) depinject.Config { config := init.ConfigProtoMessage.ProtoReflect().Type().New().Interface() err = anypb.UnmarshalTo(module.Config, config, proto.UnmarshalOptions{}) if err != nil { - return depinject.Error(err) } diff --git a/crypto/keyring/keyring_test.go b/crypto/keyring/keyring_test.go index 235a66d2687..66c326598b7 100644 --- a/crypto/keyring/keyring_test.go +++ b/crypto/keyring/keyring_test.go @@ -157,7 +157,7 @@ func TestKeyManagementKeyRing(t *testing.T) { // create some random directory inside the keyring directory to check migrate ignores // all files other than *.info newPath := filepath.Join(tempDir, "random") - require.NoError(t, os.Mkdir(newPath, 0755)) + require.NoError(t, os.Mkdir(newPath, 0o755)) items, err := os.ReadDir(tempDir) require.GreaterOrEqual(t, len(items), 2) keyS, err = kb.List() diff --git a/crypto/keys/secp256k1/internal/secp256k1/curve.go b/crypto/keys/secp256k1/internal/secp256k1/curve.go index b5c80b23ad6..ab2277f989c 100644 --- a/crypto/keys/secp256k1/internal/secp256k1/curve.go +++ b/crypto/keys/secp256k1/internal/secp256k1/curve.go @@ -100,7 +100,7 @@ func (BitCurve *BitCurve) IsOnCurve(x, y *big.Int) bool { x3.Mul(x3, x) // x³ x3.Add(x3, BitCurve.B) // x³+B - x3.Mod(x3, BitCurve.P) //(x³+B)%P + x3.Mod(x3, BitCurve.P) // (x³+B)%P return x3.Cmp(y2) == 0 } @@ -222,9 +222,9 @@ func (BitCurve *BitCurve) doubleJacobian(x, y, z *big.Int) (*big.Int, *big.Int, c := new(big.Int).Mul(b, b) // B² d := new(big.Int).Add(x, b) // X1+B - d.Mul(d, d) //(X1+B)² - d.Sub(d, a) //(X1+B)²-A - d.Sub(d, c) //(X1+B)²-A-C + d.Mul(d, d) // (X1+B)² + d.Sub(d, a) // (X1+B)²-A + d.Sub(d, c) // (X1+B)²-A-C d.Mul(d, big.NewInt(2)) // 2*((X1+B)²-A-C) e := new(big.Int).Mul(big.NewInt(3), a) // 3*A diff --git a/depinject/debug.go b/depinject/debug.go index 473076f28a8..820354426aa 100644 --- a/depinject/debug.go +++ b/depinject/debug.go @@ -236,7 +236,7 @@ func (c *debugConfig) enableLogVisualizer() { func (c *debugConfig) addFileVisualizer(filename string) { c.visualizers = append(c.visualizers, func(_ string) { dotStr := c.graph.String() - err := os.WriteFile(filename, []byte(dotStr), 0644) + err := os.WriteFile(filename, []byte(dotStr), 0o644) if err != nil { c.logf("Error saving graphviz file %s: %+v", filename, err) } else { diff --git a/pruning/manager.go b/pruning/manager.go index 8e7c61cc9ef..ac1172ebb86 100644 --- a/pruning/manager.go +++ b/pruning/manager.go @@ -13,7 +13,7 @@ import ( ) // Manager is an abstraction to handle the logic needed for -// determinging when to prune old heights of the store +// determining when to prune old heights of the store // based on the strategy described by the pruning options. type Manager struct { db dbm.DB diff --git a/runtime/module.go b/runtime/module.go index ac053b1f631..399e9ad2c0b 100644 --- a/runtime/module.go +++ b/runtime/module.go @@ -43,7 +43,8 @@ func provideCodecs(moduleBasics map[string]AppModuleBasicWrapper) ( codec.Codec, *codec.LegacyAmino, appWrapper, - codec.ProtoCodecMarshaler) { + codec.ProtoCodecMarshaler, +) { interfaceRegistry := codectypes.NewInterfaceRegistry() amino := codec.NewLegacyAmino() diff --git a/server/mock/tx.go b/server/mock/tx.go index 0cb79c28986..3c93ffb8341 100644 --- a/server/mock/tx.go +++ b/server/mock/tx.go @@ -21,8 +21,10 @@ func (msg kvstoreTx) Reset() {} func (msg kvstoreTx) String() string { return "TODO" } func (msg kvstoreTx) ProtoMessage() {} -var _ sdk.Tx = kvstoreTx{} -var _ sdk.Msg = kvstoreTx{} +var ( + _ sdk.Tx = kvstoreTx{} + _ sdk.Msg = kvstoreTx{} +) func NewTx(key, value string) kvstoreTx { bytes := fmt.Sprintf("%s=%s", key, value) diff --git a/server/tm_cmds.go b/server/tm_cmds.go index 6cc63850ff7..a664131894c 100644 --- a/server/tm_cmds.go +++ b/server/tm_cmds.go @@ -165,7 +165,6 @@ func makeKeyMigrateCmd() *cobra.Command { ID: dbctx, Config: config, }) - if err != nil { return fmt.Errorf("constructing database handle: %w", err) } @@ -178,7 +177,6 @@ func makeKeyMigrateCmd() *cobra.Command { if dbctx == "blockstore" { if err := scmigrate.Migrate(ctx, db); err != nil { return fmt.Errorf("running seen commit migration: %w", err) - } } } diff --git a/simapp/app.go b/simapp/app.go index 51cfbaf7ff0..02d711bf1e8 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -346,11 +346,13 @@ func NewSimApp( // NOTE: Capability module must occur first so that it can initialize any capabilities // so that other modules that want to create or claim capabilities afterwards in InitChain // can do so safely. - genesisModuleOrder := []string{capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, + genesisModuleOrder := []string{ + capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, distrtypes.ModuleName, stakingtypes.ModuleName, slashingtypes.ModuleName, govtypes.ModuleName, minttypes.ModuleName, crisistypes.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName, feegrant.ModuleName, nft.ModuleName, group.ModuleName, paramstypes.ModuleName, upgradetypes.ModuleName, - vestingtypes.ModuleName} + vestingtypes.ModuleName, + } app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...) app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...) @@ -434,7 +436,6 @@ func (app *SimApp) setAnteHandler(txConfig client.TxConfig, indexEventsStr []str SigGasConsumer: ante.DefaultSigVerificationGasConsumer, }, ) - if err != nil { panic(err) } diff --git a/simapp/test_helpers.go b/simapp/test_helpers.go index 3c9beddc7ca..b7dbfedc51e 100644 --- a/simapp/test_helpers.go +++ b/simapp/test_helpers.go @@ -6,12 +6,13 @@ import ( "encoding/hex" "encoding/json" "fmt" - "github.com/cosmos/cosmos-sdk/depinject" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" "strconv" "testing" "time" + "github.com/cosmos/cosmos-sdk/depinject" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" tmjson "github.com/tendermint/tendermint/libs/json" diff --git a/snapshots/types/util.go b/snapshots/types/util.go index 125ea6fb461..348b5057682 100644 --- a/snapshots/types/util.go +++ b/snapshots/types/util.go @@ -4,7 +4,7 @@ import ( protoio "github.com/gogo/protobuf/io" ) -// WriteExtensionItem writes an item payload for current extention snapshotter. +// WriteExtensionItem writes an item payload for current extension snapshotter. func WriteExtensionItem(protoWriter protoio.Writer, item []byte) error { return protoWriter.WriteMsg(&SnapshotItem{ Item: &SnapshotItem_ExtensionPayload{ diff --git a/store/streaming/constructor_test.go b/store/streaming/constructor_test.go index 79051d16500..1b0479cc7d5 100644 --- a/store/streaming/constructor_test.go +++ b/store/streaming/constructor_test.go @@ -81,7 +81,6 @@ func TestLoadStreamingServices(t *testing.T) { require.Equal(t, tc.activeStreamersLen, len(activeStreamers)) }) } - } type streamingAppOptions struct { diff --git a/store/v2alpha1/smt/ics23.go b/store/v2alpha1/smt/ics23.go index 31d78f993dc..3c429922729 100644 --- a/store/v2alpha1/smt/ics23.go +++ b/store/v2alpha1/smt/ics23.go @@ -104,7 +104,7 @@ func convertInnerOps(path []byte, sideNodes [][]byte) []*ics23.InnerOp { Hash: ics23.HashOp_SHA256, Prefix: []byte{1}, } - if getBitAtFromMSB(path[:], depth-1-i) == 1 { + if getBitAtFromMSB(path, depth-1-i) == 1 { // right child is on path op.Prefix = append(op.Prefix, sideNodes[i]...) } else { diff --git a/types/coin.go b/types/coin.go index c5bf96aeac0..142476f4b39 100644 --- a/types/coin.go +++ b/types/coin.go @@ -411,7 +411,7 @@ func (coins Coins) SafeSub(coinsB ...Coin) (Coins, bool) { } // MulInt performs the scalar multiplication of coins with a `multiplier` -// All coins are multipled by x +// All coins are multiplied by x // e.g. // {2A, 3B} * 2 = {4A, 6B} // {2A} * 0 panics diff --git a/types/kv/list.go b/types/kv/list.go index 2b0793d343c..872f88932d1 100644 --- a/types/kv/list.go +++ b/types/kv/list.go @@ -113,7 +113,7 @@ func (l *List) remove(e *Element) *Element { } // move moves e to next to at and returns e. -// nolint: unparam + func (l *List) move(e, at *Element) *Element { if e == at { return e diff --git a/x/auth/ante/ante_test.go b/x/auth/ante/ante_test.go index 6ff5532a438..1e6f8ace5bc 100644 --- a/x/auth/ante/ante_test.go +++ b/x/auth/ante/ante_test.go @@ -511,7 +511,6 @@ func (suite *AnteTestSuite) TestAnteHandlerFees() { for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.desc), func() { - suite.txBuilder = suite.clientCtx.TxConfig.NewTxBuilder() tc.malleate() diff --git a/x/auth/ante/basic_test.go b/x/auth/ante/basic_test.go index 4a8cb830fdf..761e7a2b8e8 100644 --- a/x/auth/ante/basic_test.go +++ b/x/auth/ante/basic_test.go @@ -168,10 +168,8 @@ func (suite *AnteTestSuite) TestConsumeGasForTxSize() { // require that antehandler passes and does not underestimate decorator cost suite.Require().Nil(err, "ConsumeTxSizeGasDecorator returned error: %v", err) suite.Require().True(consumedSimGas >= expectedGas, "Simulate mode underestimates gas on AnteDecorator. Simulated cost: %d, expected cost: %d", consumedSimGas, expectedGas) - }) } - } func (suite *AnteTestSuite) TestTxHeightTimeoutDecorator() { diff --git a/x/auth/ante/setup.go b/x/auth/ante/setup.go index 6d6d4344c0c..4e9ffe862b9 100644 --- a/x/auth/ante/setup.go +++ b/x/auth/ante/setup.go @@ -8,9 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" ) -var ( - _ GasTx = (*legacytx.StdTx)(nil) // assert StdTx implements GasTx -) +var _ GasTx = (*legacytx.StdTx)(nil) // assert StdTx implements GasTx // GasTx defines a Tx with a GetGas() method which is needed to use SetUpContextDecorator type GasTx interface { diff --git a/x/auth/ante/sigverify.go b/x/auth/ante/sigverify.go index c77632a7d02..7363307af12 100644 --- a/x/auth/ante/sigverify.go +++ b/x/auth/ante/sigverify.go @@ -425,7 +425,6 @@ func ConsumeMultisignatureVerificationGas( meter sdk.GasMeter, sig *signing.MultiSignatureData, pubkey multisig.PubKey, params types.Params, accSeq uint64, ) error { - size := sig.BitArray.Count() sigIndex := 0 diff --git a/x/auth/module.go b/x/auth/module.go index dd68ec62da8..feec8ccacce 100644 --- a/x/auth/module.go +++ b/x/auth/module.go @@ -219,8 +219,8 @@ func provideModule( config *modulev1.Module, key *store.KVStoreKey, cdc codec.Codec, - subspace paramtypes.Subspace) authOutputs { - + subspace paramtypes.Subspace, +) authOutputs { maccPerms := map[string][]string{} for _, permission := range config.ModuleAccountPermissions { maccPerms[permission.Account] = permission.Permissions diff --git a/x/auth/tx/builder.go b/x/auth/tx/builder.go index 052da8785ee..ab875867107 100644 --- a/x/auth/tx/builder.go +++ b/x/auth/tx/builder.go @@ -34,12 +34,12 @@ type wrapper struct { } var ( - _ authsigning.Tx = &wrapper{} - _ client.TxBuilder = &wrapper{} - _ tx.TipTx = &wrapper{} + _ authsigning.Tx = &wrapper{} + _ client.TxBuilder = &wrapper{} + _ tx.TipTx = &wrapper{} _ ante.HasExtensionOptionsTx = &wrapper{} - _ ExtensionOptionsTxBuilder = &wrapper{} - _ tx.TipTx = &wrapper{} + _ ExtensionOptionsTxBuilder = &wrapper{} + _ tx.TipTx = &wrapper{} ) // ExtensionOptionsTxBuilder defines a TxBuilder that can also set extensions. diff --git a/x/auth/tx/service.go b/x/auth/tx/service.go index 414ed31b200..9e7f19894b4 100644 --- a/x/auth/tx/service.go +++ b/x/auth/tx/service.go @@ -181,7 +181,7 @@ func (s txServer) GetBlockWithTxs(ctx context.Context, req *txtypes.GetBlockWith "or greater than the current height %d", req.Height, currentHeight) } - blockId, block, err := tmservice.GetProtoBlock(ctx, s.clientCtx, &req.Height) + blockID, block, err := tmservice.GetProtoBlock(ctx, s.clientCtx, &req.Height) if err != nil { return nil, err } @@ -230,7 +230,7 @@ func (s txServer) GetBlockWithTxs(ctx context.Context, req *txtypes.GetBlockWith return &txtypes.GetBlockWithTxsResponse{ Txs: txs, - BlockId: &blockId, + BlockId: &blockID, Block: block, Pagination: &pagination.PageResponse{ Total: blockTxsLn, diff --git a/x/authz/keeper/keeper.go b/x/authz/keeper/keeper.go index 5ccb7e0de6f..137e07dc944 100644 --- a/x/authz/keeper/keeper.go +++ b/x/authz/keeper/keeper.go @@ -323,10 +323,10 @@ func (keeper Keeper) removeFromGrantQueue(ctx sdk.Context, grantKey []byte, gran _, _, msgType := parseGrantStoreKey(grantKey) queueItems := queueItem.MsgTypeUrls - for index, typeUrl := range queueItems { + for index, typeURL := range queueItems { ctx.GasMeter().ConsumeGas(gasCostPerIteration, "grant queue") - if typeUrl == msgType { + if typeURL == msgType { end := len(queueItem.MsgTypeUrls) - 1 queueItems[index] = queueItems[end] queueItems = queueItems[:end] @@ -363,8 +363,8 @@ func (k Keeper) DequeueAndDeleteExpiredGrants(ctx sdk.Context) error { store.Delete(iterator.Key()) - for _, typeUrl := range queueItem.MsgTypeUrls { - store.Delete(grantStoreKey(grantee, granter, typeUrl)) + for _, typeURL := range queueItem.MsgTypeUrls { + store.Delete(grantStoreKey(grantee, granter, typeURL)) } } diff --git a/x/authz/module/abci.go b/x/authz/module/abci.go index c9e6fef5e7a..c1015abae84 100644 --- a/x/authz/module/abci.go +++ b/x/authz/module/abci.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/authz/keeper" ) -// BeginBlocker is called at the begining of every block +// BeginBlocker is called at the beginning of every block func BeginBlocker(ctx sdk.Context, keeper keeper.Keeper) { // delete all the mature grants if err := keeper.DequeueAndDeleteExpiredGrants(ctx); err != nil { diff --git a/x/bank/module.go b/x/bank/module.go index e8b5266f6ac..687f1a39d55 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -4,6 +4,8 @@ import ( "context" "encoding/json" "fmt" + "math/rand" + "time" modulev1 "cosmossdk.io/api/cosmos/bank/module/v1" "github.com/cosmos/cosmos-sdk/depinject" @@ -11,9 +13,6 @@ import ( paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/tendermint/tendermint/crypto" - "math/rand" - "time" - "cosmossdk.io/core/appmodule" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 8800d2d79ec..6c5d9be5a67 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -12,7 +12,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) diff --git a/x/gov/keeper/querier.go b/x/gov/keeper/querier.go index 14e8bc83b2b..d528f33cf7e 100644 --- a/x/gov/keeper/querier.go +++ b/x/gov/keeper/querier.go @@ -75,7 +75,6 @@ func queryParams(ctx sdk.Context, path []string, req abci.RequestQuery, keeper K } } -// nolint: unparam func queryProposal(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { var params v1.QueryProposalParams err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) @@ -96,7 +95,6 @@ func queryProposal(ctx sdk.Context, path []string, req abci.RequestQuery, keeper return bz, nil } -// nolint: unparam func queryDeposit(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { var params v1.QueryDepositParams err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) @@ -113,7 +111,6 @@ func queryDeposit(ctx sdk.Context, path []string, req abci.RequestQuery, keeper return bz, nil } -// nolint: unparam func queryVote(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { var params v1.QueryVoteParams err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) @@ -130,7 +127,6 @@ func queryVote(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Kee return bz, nil } -// nolint: unparam func queryDeposits(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { var params v1.QueryProposalParams err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) @@ -151,7 +147,6 @@ func queryDeposits(ctx sdk.Context, path []string, req abci.RequestQuery, keeper return bz, nil } -// nolint: unparam func queryTally(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { var params v1.QueryProposalParams err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) @@ -188,7 +183,6 @@ func queryTally(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Ke return bz, nil } -// nolint: unparam func queryVotes(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { var params v1.QueryProposalVotesParams err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) diff --git a/x/gov/migrations/v046/convert.go b/x/gov/migrations/v046/convert.go index a3f383006b5..54ff7d4911a 100644 --- a/x/gov/migrations/v046/convert.go +++ b/x/gov/migrations/v046/convert.go @@ -6,7 +6,7 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) diff --git a/x/gov/types/v1beta1/proposals_test.go b/x/gov/types/v1beta1/proposals_test.go index 2a29fda2875..6f3bee6092f 100644 --- a/x/gov/types/v1beta1/proposals_test.go +++ b/x/gov/types/v1beta1/proposals_test.go @@ -54,5 +54,4 @@ func TestContentFromProposalType(t *testing.T) { require.NotNil(t, content) require.Equal(t, test.expectedType, content.ProposalType()) } - } diff --git a/x/group/client/testutil/tx.go b/x/group/client/testutil/tx.go index 1458dc4fd33..879c7baef22 100644 --- a/x/group/client/testutil/tx.go +++ b/x/group/client/testutil/tx.go @@ -213,7 +213,6 @@ func (s *IntegrationTestSuite) TestTxCreateGroup() { val := s.network.Validators[0] clientCtx := val.ClientCtx - validMembers := fmt.Sprintf(`{"members": [{ "address": "%s", "weight": "1", @@ -366,7 +365,6 @@ func (s *IntegrationTestSuite) TestTxUpdateGroupAdmin() { clientCtx := val.ClientCtx require := s.Require() - groupIDs := make([]string, 2) for i := 0; i < 2; i++ { validMembers := fmt.Sprintf(`{"members": [{ @@ -487,7 +485,6 @@ func (s *IntegrationTestSuite) TestTxUpdateGroupMetadata() { val := s.network.Validators[0] clientCtx := val.ClientCtx - testCases := []struct { name string args []string @@ -568,7 +565,6 @@ func (s *IntegrationTestSuite) TestTxUpdateGroupMembers() { val := s.network.Validators[0] clientCtx := val.ClientCtx - weights := []string{"1", "1", "1"} accounts := s.createAccounts(3) @@ -691,9 +687,6 @@ func (s *IntegrationTestSuite) TestTxCreateGroupWithPolicy() { val := s.network.Validators[0] clientCtx := val.ClientCtx - - - validMembers := fmt.Sprintf(`{"members": [{ "address": "%s", "weight": "1", @@ -899,7 +892,6 @@ func (s *IntegrationTestSuite) TestTxCreateGroupPolicy() { wrongAdmin := s.network.Validators[1].Address clientCtx := val.ClientCtx - groupID := s.group.Id testCases := []struct { @@ -1067,7 +1059,6 @@ func (s *IntegrationTestSuite) TestTxUpdateGroupPolicyAdmin() { clientCtx := val.ClientCtx groupPolicy := s.groupPolicies[3] - commonFlags := s.commonFlags commonFlags = append(commonFlags, fmt.Sprintf("--%s=%d", flags.FlagGas, 300000)) @@ -1168,7 +1159,6 @@ func (s *IntegrationTestSuite) TestTxUpdateGroupPolicyDecisionPolicy() { clientCtx := val.ClientCtx groupPolicy := s.groupPolicies[2] - commonFlags := s.commonFlags commonFlags = append(commonFlags, fmt.Sprintf("--%s=%d", flags.FlagGas, 300000)) @@ -1314,7 +1304,6 @@ func (s *IntegrationTestSuite) TestTxUpdateGroupPolicyMetadata() { clientCtx := val.ClientCtx groupPolicy := s.groupPolicies[2] - commonFlags := s.commonFlags commonFlags = append(commonFlags, fmt.Sprintf("--%s=%d", flags.FlagGas, 300000)) @@ -1428,7 +1417,6 @@ func (s *IntegrationTestSuite) TestTxSubmitProposal() { val := s.network.Validators[0] clientCtx := val.ClientCtx - testCases := []struct { name string args []string @@ -1617,7 +1605,6 @@ func (s *IntegrationTestSuite) TestTxVote() { val := s.network.Validators[0] clientCtx := val.ClientCtx - ids := make([]string, 4) weights := []string{"1", "1", "1"} accounts := s.createAccounts(3) @@ -1811,7 +1798,6 @@ func (s *IntegrationTestSuite) TestTxWithdrawProposal() { val := s.network.Validators[0] clientCtx := val.ClientCtx - ids := make([]string, 2) for i := 0; i < 2; i++ { @@ -1954,7 +1940,6 @@ func (s *IntegrationTestSuite) TestTxExec() { clientCtx := val.ClientCtx require := s.Require() - var proposalIDs []string // create proposals and vote for i := 0; i < 2; i++ { @@ -2428,10 +2413,8 @@ func (s *IntegrationTestSuite) TestExecProposalsWhenMemberLeavesOrIsUpdated() { if tc.expectLogErr { s.Require().Contains(execResp.RawLog, tc.errMsg) } - }) } - } func (s *IntegrationTestSuite) getGroupIDFromTxResponse(txResp sdk.TxResponse) string { @@ -2551,7 +2534,7 @@ func (s *IntegrationTestSuite) createGroupThresholdPolicyWithBalance(adminAddres s.commonFlags..., ), ) - var txResp = sdk.TxResponse{} + txResp := sdk.TxResponse{} s.Require().NoError(err, out.String()) s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &txResp), out.String()) s.Require().Equal(uint32(0), txResp.Code, out.String()) diff --git a/x/group/keeper/grpc_query.go b/x/group/keeper/grpc_query.go index f9bef8c8b22..ff26844dde5 100644 --- a/x/group/keeper/grpc_query.go +++ b/x/group/keeper/grpc_query.go @@ -321,9 +321,9 @@ func (k Keeper) getVotesByVoter(ctx sdk.Context, voter sdk.AccAddress, pageReque // TallyResult computes the live tally result of a proposal. func (k Keeper) TallyResult(goCtx context.Context, request *group.QueryTallyResultRequest) (*group.QueryTallyResultResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - proposalId := request.ProposalId + proposalID := request.ProposalId - proposal, err := k.getProposal(ctx, proposalId) + proposal, err := k.getProposal(ctx, proposalID) if err != nil { return nil, err } diff --git a/x/group/keeper/keeper.go b/x/group/keeper/keeper.go index 93cd875da5a..b5673893051 100644 --- a/x/group/keeper/keeper.go +++ b/x/group/keeper/keeper.go @@ -369,12 +369,12 @@ func (k Keeper) TallyProposalsAtVPEnd(ctx sdk.Context) error { return true, sdkerrors.Wrap(err, "group") } - proposalId := proposal.Id + proposalID := proposal.Id if proposal.Status == group.PROPOSAL_STATUS_ABORTED || proposal.Status == group.PROPOSAL_STATUS_WITHDRAWN { - if err := k.pruneProposal(ctx, proposalId); err != nil { + if err := k.pruneProposal(ctx, proposalID); err != nil { return true, err } - if err := k.pruneVotes(ctx, proposalId); err != nil { + if err := k.pruneVotes(ctx, proposalID); err != nil { return true, err } } else { diff --git a/x/group/keeper/keeper_test.go b/x/group/keeper/keeper_test.go index 84ee34bcdf8..c82ad1b1e49 100644 --- a/x/group/keeper/keeper_test.go +++ b/x/group/keeper/keeper_test.go @@ -2829,7 +2829,6 @@ func (s *TestSuite) TestLeaveGroup() { } } - func (s *TestSuite) TestPruneProposals() { addrs := s.addrs expirationTime := time.Hour * 24 * 15 // 15 days diff --git a/x/group/keeper/msg_server.go b/x/group/keeper/msg_server.go index 6a25c5dce3f..dde4bb222c5 100644 --- a/x/group/keeper/msg_server.go +++ b/x/group/keeper/msg_server.go @@ -161,7 +161,7 @@ func (k Keeper) UpdateGroupMembers(goCtx context.Context, req *group.MsgUpdateGr if err != nil { return err } - // Substract previous weight from the group total weight. + // Subtract previous weight from the group total weight. totalWeight, err = math.SubNonNegative(totalWeight, previousMemberWeight) if err != nil { return err @@ -248,12 +248,12 @@ func (k Keeper) CreateGroupWithPolicy(goCtx context.Context, req *group.MsgCreat if err != nil { return nil, sdkerrors.Wrap(err, "group response") } - groupId := groupRes.GroupId + groupID := groupRes.GroupId var groupPolicyAddr sdk.AccAddress groupPolicyRes, err := k.CreateGroupPolicy(goCtx, &group.MsgCreateGroupPolicy{ Admin: req.Admin, - GroupId: groupId, + GroupId: groupID, Metadata: req.GroupPolicyMetadata, DecisionPolicy: req.DecisionPolicy, }) @@ -270,7 +270,7 @@ func (k Keeper) CreateGroupWithPolicy(goCtx context.Context, req *group.MsgCreat if req.GroupPolicyAsAdmin { updateAdminReq := &group.MsgUpdateGroupAdmin{ - GroupId: groupId, + GroupId: groupID, Admin: req.Admin, NewAdmin: groupPolicyAddress, } @@ -290,7 +290,7 @@ func (k Keeper) CreateGroupWithPolicy(goCtx context.Context, req *group.MsgCreat } } - return &group.MsgCreateGroupWithPolicyResponse{GroupId: groupId, GroupPolicyAddress: groupPolicyAddress}, nil + return &group.MsgCreateGroupWithPolicyResponse{GroupId: groupID, GroupPolicyAddress: groupPolicyAddress}, nil } func (k Keeper) CreateGroupPolicy(goCtx context.Context, req *group.MsgCreateGroupPolicy) (*group.MsgCreateGroupPolicyResponse, error) { diff --git a/x/group/keeper/tally.go b/x/group/keeper/tally.go index 931c949696c..d3ffedfd5ed 100644 --- a/x/group/keeper/tally.go +++ b/x/group/keeper/tally.go @@ -10,7 +10,7 @@ import ( // Tally is a function that tallies a proposal by iterating through its votes, // and returns the tally result without modifying the proposal or any state. -func (k Keeper) Tally(ctx sdk.Context, p group.Proposal, groupId uint64) (group.TallyResult, error) { +func (k Keeper) Tally(ctx sdk.Context, p group.Proposal, groupID uint64) (group.TallyResult, error) { // If proposal has already been tallied and updated, then its status is // accepted/rejected, in which case we just return the previously stored result. // @@ -40,7 +40,7 @@ func (k Keeper) Tally(ctx sdk.Context, p group.Proposal, groupId uint64) (group. var member group.GroupMember err := k.groupMemberTable.GetOne(ctx.KVStore(k.key), orm.PrimaryKey(&group.GroupMember{ - GroupId: groupId, + GroupId: groupID, Member: &group.Member{Address: vote.Voter}, }), &member) diff --git a/x/nft/client/testutil/grpc.go b/x/nft/client/testutil/grpc.go index 8d98182c5b7..11ba5b77724 100644 --- a/x/nft/client/testutil/grpc.go +++ b/x/nft/client/testutil/grpc.go @@ -12,7 +12,7 @@ func (s *IntegrationTestSuite) TestQueryBalanceGRPC() { testCases := []struct { name string args struct { - ClassId string + ClassID string Owner string } expectErr bool @@ -22,10 +22,10 @@ func (s *IntegrationTestSuite) TestQueryBalanceGRPC() { { name: "fail not exist class id", args: struct { - ClassId string + ClassID string Owner string }{ - ClassId: "invalid_class_id", + ClassID: "invalid_class_id", Owner: s.owner.String(), }, expectErr: true, @@ -35,10 +35,10 @@ func (s *IntegrationTestSuite) TestQueryBalanceGRPC() { { name: "fail not exist owner", args: struct { - ClassId string + ClassID string Owner string }{ - ClassId: ExpNFT.ClassId, + ClassID: ExpNFT.ClassId, Owner: s.owner.String(), }, expectErr: false, @@ -47,10 +47,10 @@ func (s *IntegrationTestSuite) TestQueryBalanceGRPC() { { name: "success", args: struct { - ClassId string + ClassID string Owner string }{ - ClassId: ExpNFT.ClassId, + ClassID: ExpNFT.ClassId, Owner: val.Address.String(), }, expectErr: false, @@ -59,7 +59,7 @@ func (s *IntegrationTestSuite) TestQueryBalanceGRPC() { } balanceURL := val.APIAddress + "/cosmos/nft/v1beta1/balance/%s/%s" for _, tc := range testCases { - uri := fmt.Sprintf(balanceURL, tc.args.Owner, tc.args.ClassId) + uri := fmt.Sprintf(balanceURL, tc.args.Owner, tc.args.ClassID) s.Run(tc.name, func() { resp, _ := rest.GetRequest(uri) if tc.expectErr { @@ -80,8 +80,8 @@ func (s *IntegrationTestSuite) TestQueryOwnerGRPC() { testCases := []struct { name string args struct { - ClassId string - Id string + ClassID string + ID string } expectErr bool errMsg string @@ -90,11 +90,11 @@ func (s *IntegrationTestSuite) TestQueryOwnerGRPC() { { name: "class id is invalid", args: struct { - ClassId string - Id string + ClassID string + ID string }{ - ClassId: "invalid_class_id", - Id: ExpNFT.Id, + ClassID: "invalid_class_id", + ID: ExpNFT.Id, }, expectErr: true, errMsg: "invalid class id", @@ -103,11 +103,11 @@ func (s *IntegrationTestSuite) TestQueryOwnerGRPC() { { name: "class id does not exist", args: struct { - ClassId string - Id string + ClassID string + ID string }{ - ClassId: "class-id", - Id: ExpNFT.Id, + ClassID: "class-id", + ID: ExpNFT.Id, }, expectErr: false, expectResult: "", @@ -115,11 +115,11 @@ func (s *IntegrationTestSuite) TestQueryOwnerGRPC() { { name: "nft id is invalid", args: struct { - ClassId string - Id string + ClassID string + ID string }{ - ClassId: ExpNFT.ClassId, - Id: "invalid_nft_id", + ClassID: ExpNFT.ClassId, + ID: "invalid_nft_id", }, expectErr: true, expectResult: "", @@ -127,11 +127,11 @@ func (s *IntegrationTestSuite) TestQueryOwnerGRPC() { { name: "nft id does not exist", args: struct { - ClassId string - Id string + ClassID string + ID string }{ - ClassId: ExpNFT.ClassId, - Id: "nft-id", + ClassID: ExpNFT.ClassId, + ID: "nft-id", }, expectErr: false, expectResult: "", @@ -139,11 +139,11 @@ func (s *IntegrationTestSuite) TestQueryOwnerGRPC() { { name: "nft exist", args: struct { - ClassId string - Id string + ClassID string + ID string }{ - ClassId: ExpNFT.ClassId, - Id: ExpNFT.Id, + ClassID: ExpNFT.ClassId, + ID: ExpNFT.Id, }, expectErr: false, expectResult: val.Address.String(), @@ -151,7 +151,7 @@ func (s *IntegrationTestSuite) TestQueryOwnerGRPC() { } ownerURL := val.APIAddress + "/cosmos/nft/v1beta1/owner/%s/%s" for _, tc := range testCases { - uri := fmt.Sprintf(ownerURL, tc.args.ClassId, tc.args.Id) + uri := fmt.Sprintf(ownerURL, tc.args.ClassID, tc.args.ID) s.Run(tc.name, func() { resp, err := rest.GetRequest(uri) if tc.expectErr { @@ -173,7 +173,7 @@ func (s *IntegrationTestSuite) TestQuerySupplyGRPC() { testCases := []struct { name string args struct { - ClassId string + ClassID string } expectErr bool errMsg string @@ -182,9 +182,9 @@ func (s *IntegrationTestSuite) TestQuerySupplyGRPC() { { name: "class id is invalid", args: struct { - ClassId string + ClassID string }{ - ClassId: "invalid_class_id", + ClassID: "invalid_class_id", }, expectErr: true, errMsg: "invalid class id", @@ -193,9 +193,9 @@ func (s *IntegrationTestSuite) TestQuerySupplyGRPC() { { name: "class id does not exist", args: struct { - ClassId string + ClassID string }{ - ClassId: "class-id", + ClassID: "class-id", }, expectErr: false, expectResult: 0, @@ -203,9 +203,9 @@ func (s *IntegrationTestSuite) TestQuerySupplyGRPC() { { name: "class id exist", args: struct { - ClassId string + ClassID string }{ - ClassId: ExpNFT.ClassId, + ClassID: ExpNFT.ClassId, }, expectErr: false, expectResult: 1, @@ -213,7 +213,7 @@ func (s *IntegrationTestSuite) TestQuerySupplyGRPC() { } supplyURL := val.APIAddress + "/cosmos/nft/v1beta1/supply/%s" for _, tc := range testCases { - uri := fmt.Sprintf(supplyURL, tc.args.ClassId) + uri := fmt.Sprintf(supplyURL, tc.args.ClassID) s.Run(tc.name, func() { resp, err := rest.GetRequest(uri) if tc.expectErr { @@ -234,7 +234,7 @@ func (s *IntegrationTestSuite) TestQueryNFTsGRPC() { testCases := []struct { name string args struct { - ClassId string + ClassID string Owner string } expectErr bool @@ -244,7 +244,7 @@ func (s *IntegrationTestSuite) TestQueryNFTsGRPC() { { name: "classID and owner are both empty", args: struct { - ClassId string + ClassID string Owner string }{}, errorMsg: "must provide at least one of classID or owner", @@ -254,10 +254,10 @@ func (s *IntegrationTestSuite) TestQueryNFTsGRPC() { { name: "classID is invalid", args: struct { - ClassId string + ClassID string Owner string }{ - ClassId: "invalid_class_id", + ClassID: "invalid_class_id", }, expectErr: true, expectResult: []*nft.NFT{}, @@ -265,10 +265,10 @@ func (s *IntegrationTestSuite) TestQueryNFTsGRPC() { { name: "classID does not exist", args: struct { - ClassId string + ClassID string Owner string }{ - ClassId: "class-id", + ClassID: "class-id", }, expectErr: false, expectResult: []*nft.NFT{}, @@ -276,10 +276,10 @@ func (s *IntegrationTestSuite) TestQueryNFTsGRPC() { { name: "success query by classID", args: struct { - ClassId string + ClassID string Owner string }{ - ClassId: ExpNFT.ClassId, + ClassID: ExpNFT.ClassId, }, expectErr: false, expectResult: []*nft.NFT{&ExpNFT}, @@ -287,7 +287,7 @@ func (s *IntegrationTestSuite) TestQueryNFTsGRPC() { { name: "success query by owner", args: struct { - ClassId string + ClassID string Owner string }{ Owner: val.Address.String(), @@ -298,10 +298,10 @@ func (s *IntegrationTestSuite) TestQueryNFTsGRPC() { { name: "success query by owner and classID", args: struct { - ClassId string + ClassID string Owner string }{ - ClassId: ExpNFT.ClassId, + ClassID: ExpNFT.ClassId, Owner: val.Address.String(), }, expectErr: false, @@ -310,7 +310,7 @@ func (s *IntegrationTestSuite) TestQueryNFTsGRPC() { } nftsOfClassURL := val.APIAddress + "/cosmos/nft/v1beta1/nfts?class_id=%s&owner=%s" for _, tc := range testCases { - uri := fmt.Sprintf(nftsOfClassURL, tc.args.ClassId, tc.args.Owner) + uri := fmt.Sprintf(nftsOfClassURL, tc.args.ClassID, tc.args.Owner) s.Run(tc.name, func() { resp, err := rest.GetRequest(uri) if tc.expectErr { @@ -331,8 +331,8 @@ func (s *IntegrationTestSuite) TestQueryNFTGRPC() { testCases := []struct { name string args struct { - ClassId string - Id string + ClassID string + ID string } expectErr bool errorMsg string @@ -340,11 +340,11 @@ func (s *IntegrationTestSuite) TestQueryNFTGRPC() { { name: "class id is invalid", args: struct { - ClassId string - Id string + ClassID string + ID string }{ - ClassId: "invalid_class_id", - Id: ExpNFT.Id, + ClassID: "invalid_class_id", + ID: ExpNFT.Id, }, expectErr: true, errorMsg: "invalid class id", @@ -352,11 +352,11 @@ func (s *IntegrationTestSuite) TestQueryNFTGRPC() { { name: "class id does not exist", args: struct { - ClassId string - Id string + ClassID string + ID string }{ - ClassId: "class", - Id: ExpNFT.Id, + ClassID: "class", + ID: ExpNFT.Id, }, expectErr: true, errorMsg: "not found nft", @@ -364,11 +364,11 @@ func (s *IntegrationTestSuite) TestQueryNFTGRPC() { { name: "nft id is invalid", args: struct { - ClassId string - Id string + ClassID string + ID string }{ - ClassId: ExpNFT.ClassId, - Id: "invalid_nft_id", + ClassID: ExpNFT.ClassId, + ID: "invalid_nft_id", }, expectErr: true, errorMsg: "invalid nft id", @@ -376,11 +376,11 @@ func (s *IntegrationTestSuite) TestQueryNFTGRPC() { { name: "nft id does not exist", args: struct { - ClassId string - Id string + ClassID string + ID string }{ - ClassId: ExpNFT.ClassId, - Id: "nft-id", + ClassID: ExpNFT.ClassId, + ID: "nft-id", }, expectErr: true, errorMsg: "not found nft", @@ -388,18 +388,18 @@ func (s *IntegrationTestSuite) TestQueryNFTGRPC() { { name: "exist nft", args: struct { - ClassId string - Id string + ClassID string + ID string }{ - ClassId: ExpNFT.ClassId, - Id: ExpNFT.Id, + ClassID: ExpNFT.ClassId, + ID: ExpNFT.Id, }, expectErr: false, }, } nftURL := val.APIAddress + "/cosmos/nft/v1beta1/nfts/%s/%s" for _, tc := range testCases { - uri := fmt.Sprintf(nftURL, tc.args.ClassId, tc.args.Id) + uri := fmt.Sprintf(nftURL, tc.args.ClassID, tc.args.ID) s.Run(tc.name, func() { resp, err := rest.GetRequest(uri) if tc.expectErr { @@ -420,7 +420,7 @@ func (s *IntegrationTestSuite) TestQueryClassGRPC() { testCases := []struct { name string args struct { - ClassId string + ClassID string } expectErr bool errorMsg string @@ -428,9 +428,9 @@ func (s *IntegrationTestSuite) TestQueryClassGRPC() { { name: "class id does not exist", args: struct { - ClassId string + ClassID string }{ - ClassId: "class-id", + ClassID: "class-id", }, expectErr: true, errorMsg: "not found class", @@ -438,16 +438,16 @@ func (s *IntegrationTestSuite) TestQueryClassGRPC() { { name: "class id exist", args: struct { - ClassId string + ClassID string }{ - ClassId: ExpNFT.ClassId, + ClassID: ExpNFT.ClassId, }, expectErr: false, }, } classURL := val.APIAddress + "/cosmos/nft/v1beta1/classes/%s" for _, tc := range testCases { - uri := fmt.Sprintf(classURL, tc.args.ClassId) + uri := fmt.Sprintf(classURL, tc.args.ClassID) s.Run(tc.name, func() { resp, err := rest.GetRequest(uri) if tc.expectErr { diff --git a/x/params/module.go b/x/params/module.go index 6df8b234d3d..87c463883bc 100644 --- a/x/params/module.go +++ b/x/params/module.go @@ -174,7 +174,6 @@ func provideModule( cdc codec.Codec, amino *codec.LegacyAmino, ) (keeper.Keeper, runtime.AppModuleWrapper, runtime.BaseAppOption) { - k := keeper.NewKeeper(cdc, amino, kvStoreKey, transientStoreKey) m := NewAppModule(k) baseappOpt := func(app *baseapp.BaseApp) { From 24991625f0da8ea9139029680f60dc26ac6ead2a Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Fri, 3 Jun 2022 16:52:48 +0700 Subject: [PATCH 2/5] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e181fe9b0a7..d9125926aef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes +* (linting) [#12135](https://github.com/cosmos/cosmos-sdk/pull/12135/) Fix variable naming issues per enabled linters. Run gofumpt to ensure easy reviews of ongoing linting work. * (migrations) [#12028](https://github.com/cosmos/cosmos-sdk/pull/12028) Fix v0.45->v0.46 in-place store migrations. * (baseapp) [#12089](https://github.com/cosmos/cosmos-sdk/pull/12089) Include antehandler and runMsgs events in SimulateTx. * (cli) [#12095](https://github.com/cosmos/cosmos-sdk/pull/12095) Fix running a tx with --dry-run returns an error From 848b2f621471a72be41e4cb523a20f8d452e4a8e Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Fri, 3 Jun 2022 17:58:28 +0700 Subject: [PATCH 3/5] Update test_helpers.go --- simapp/test_helpers.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/simapp/test_helpers.go b/simapp/test_helpers.go index b7dbfedc51e..ccadd0f4605 100644 --- a/simapp/test_helpers.go +++ b/simapp/test_helpers.go @@ -10,8 +10,7 @@ import ( "testing" "time" - "github.com/cosmos/cosmos-sdk/depinject" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" @@ -22,6 +21,8 @@ import ( dbm "github.com/tendermint/tm-db" bam "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/depinject" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" "github.com/cosmos/cosmos-sdk/client" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" From 1dce4e40dfbd68adac2279910114b5322a6a9924 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Fri, 3 Jun 2022 20:06:25 +0700 Subject: [PATCH 4/5] Update test_helpers.go --- simapp/test_helpers.go | 1 - 1 file changed, 1 deletion(-) diff --git a/simapp/test_helpers.go b/simapp/test_helpers.go index 4d3a28e0922..82d3ade60bd 100644 --- a/simapp/test_helpers.go +++ b/simapp/test_helpers.go @@ -11,7 +11,6 @@ import ( "time" - "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" tmjson "github.com/tendermint/tendermint/libs/json" From 495237ef966734401c722172b94aae7b66e43d89 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Fri, 3 Jun 2022 20:06:51 +0700 Subject: [PATCH 5/5] Update test_helpers.go --- simapp/test_helpers.go | 1 - 1 file changed, 1 deletion(-) diff --git a/simapp/test_helpers.go b/simapp/test_helpers.go index 82d3ade60bd..c336bd5fa56 100644 --- a/simapp/test_helpers.go +++ b/simapp/test_helpers.go @@ -10,7 +10,6 @@ import ( "testing" "time" - "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" tmjson "github.com/tendermint/tendermint/libs/json"