diff --git a/core/appconfig/config_test.go b/core/appconfig/config_test.go index c1af334351d6..c5d04ba48465 100644 --- a/core/appconfig/config_test.go +++ b/core/appconfig/config_test.go @@ -118,5 +118,4 @@ modules: "@type": testpb.TestNoGoImportModule `)) expectContainerErrorContains(t, opt, "module should have ModuleDescriptor.go_import specified") - } diff --git a/core/go.mod b/core/go.mod index ce462a60efde..b9bc031a5370 100644 --- a/core/go.mod +++ b/core/go.mod @@ -21,7 +21,7 @@ require ( golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect golang.org/x/text v0.3.5 // indirect google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb // indirect - google.golang.org/grpc v1.47.0 // indirect + google.golang.org/grpc v1.48.0 // indirect gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/core/go.sum b/core/go.sum index 3ba6843578a2..35a28918998a 100644 --- a/core/go.sum +++ b/core/go.sum @@ -149,8 +149,8 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.47.0 h1:9n77onPX5F3qfFCqjy9dhn8PbNQsIKeVU04J9G7umt8= -google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.48.0 h1:rQOsyJ/8+ufEDJd/Gdsz7HG220Mh9HAhFHRGnIjda0w= +google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/cosmovisor/cmd/cosmovisor/init_test.go b/cosmovisor/cmd/cosmovisor/init_test.go index 472936eaac4b..056571f3bbb2 100644 --- a/cosmovisor/cmd/cosmovisor/init_test.go +++ b/cosmovisor/cmd/cosmovisor/init_test.go @@ -93,8 +93,10 @@ func (s *InitTestSuite) setEnv(t *testing.T, env *cosmovisorInitEnv) { } } -var _ io.Reader = BufferedPipe{} -var _ io.Writer = BufferedPipe{} +var ( + _ io.Reader = BufferedPipe{} + _ io.Writer = BufferedPipe{} +) // BufferedPipe contains a connected read/write pair of files (a pipe), // and a buffer of what goes through it that is populated in the background. diff --git a/simapp/app_legacy.go b/simapp/app_legacy.go index f0aa6f7b8df5..0bc5655c805e 100644 --- a/simapp/app_legacy.go +++ b/simapp/app_legacy.go @@ -488,7 +488,6 @@ func (app *SimApp) setAnteHandler(txConfig client.TxConfig) { SigGasConsumer: ante.DefaultSigVerificationGasConsumer, }, ) - if err != nil { panic(err) } diff --git a/types/utils.go b/types/utils.go index 7f10ce396c86..efd9a9c71a81 100644 --- a/types/utils.go +++ b/types/utils.go @@ -10,10 +10,8 @@ import ( dbm "github.com/tendermint/tm-db" ) -var ( - // This is set at compile time. Could be cleveldb, defaults is goleveldb. - backend = dbm.GoLevelDBBackend -) +// This is set at compile time. Could be cleveldb, defaults is goleveldb. +var backend = dbm.GoLevelDBBackend // SortedJSON takes any JSON and returns it sorted by keys. Also, all white-spaces // are removed. diff --git a/x/auth/ante/sigverify_test.go b/x/auth/ante/sigverify_test.go index faec68228290..d398357eb987 100644 --- a/x/auth/ante/sigverify_test.go +++ b/x/auth/ante/sigverify_test.go @@ -206,7 +206,6 @@ func (suite *AnteTestSuite) TestSigVerification() { // In the meantime, we want to make double-sure amino compatibility works. // ref: https://github.com/cosmos/cosmos-sdk/issues/7229 func (suite *AnteTestSuite) TestSigVerification_ExplicitAmino() { - // Set up TxConfig. aminoCdc := codec.NewLegacyAmino() // We're using TestMsg amino encoding in some tests, so register it here. diff --git a/x/auth/keeper/keeper.go b/x/auth/keeper/keeper.go index 1ab380ef1d53..5be67b2ba95e 100644 --- a/x/auth/keeper/keeper.go +++ b/x/auth/keeper/keeper.go @@ -79,7 +79,6 @@ func NewAccountKeeper( cdc codec.BinaryCodec, storeKey storetypes.StoreKey, proto func() types.AccountI, maccPerms map[string][]string, bech32Prefix string, authority string, ) AccountKeeper { - permAddrs := make(map[string]types.PermissionsForAddress) for name, perms := range maccPerms { permAddrs[name] = types.NewPermissionsForAddress(name, perms) diff --git a/x/auth/keeper/keeper_test.go b/x/auth/keeper/keeper_test.go index 8bf9ca3a4504..d1f135ee9097 100644 --- a/x/auth/keeper/keeper_test.go +++ b/x/auth/keeper/keeper_test.go @@ -139,7 +139,6 @@ func (suite *KeeperTestSuite) TestGetSetParams() { } func (suite *KeeperTestSuite) TestSupply_ValidatePermissions() { - err := suite.accountKeeper.ValidatePermissions(multiPermAcc) suite.Require().NoError(err) diff --git a/x/auth/migrations/v043/store_test.go b/x/auth/migrations/v043/store_test.go index 498f33972673..546ee34a6fa2 100644 --- a/x/auth/migrations/v043/store_test.go +++ b/x/auth/migrations/v043/store_test.go @@ -78,7 +78,6 @@ func TestMigrateVestingAccounts(t *testing.T) { { "delayed vesting has vested, multiple delegations less than the total account balance", func(ctx sdk.Context, validator stakingtypes.Validator, delegatorAddr sdk.AccAddress) { - baseAccount := authtypes.NewBaseAccountWithAddress(delegatorAddr) vestedCoins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdk.NewInt(200))) delayedAccount := types.NewDelayedVestingAccount(baseAccount, vestedCoins, ctx.BlockTime().Unix()) @@ -590,7 +589,6 @@ func TestMigrateVestingAccounts(t *testing.T) { for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { - err := accountKeeper.SetParams(ctx, authtypes.DefaultParams()) require.NoError(t, err) @@ -652,7 +650,6 @@ func trackingCorrected(ctx sdk.Context, t *testing.T, ak keeper.AccountKeeper, a } func cleartTrackingFields(ctx sdk.Context, vesting exported.VestingAccount, accountKeeper keeper.AccountKeeper) error { - switch t := vesting.(type) { case *types.DelayedVestingAccount: t.DelegatedFree = nil @@ -674,7 +671,6 @@ func cleartTrackingFields(ctx sdk.Context, vesting exported.VestingAccount, acco } func dirtyTrackingFields(ctx sdk.Context, vesting exported.VestingAccount, accountKeeper keeper.AccountKeeper) error { - dirt := sdk.NewCoins(sdk.NewInt64Coin("stake", 42)) switch t := vesting.(type) { @@ -698,7 +694,6 @@ func dirtyTrackingFields(ctx sdk.Context, vesting exported.VestingAccount, accou } func createValidator(t *testing.T, ctx sdk.Context, bankKeeper bankkeeper.Keeper, stakingKeeper *stakingkeeper.Keeper, powers int64) (sdk.AccAddress, sdk.ValAddress) { - valTokens := sdk.TokensFromConsensusPower(powers, sdk.DefaultPowerReduction) addrs := simtestutil.AddTestAddrsIncremental(bankKeeper, stakingKeeper, ctx, 1, valTokens) valAddrs := simtestutil.ConvertAddrsToValAddrs(addrs) diff --git a/x/auth/migrations/v046/store_test.go b/x/auth/migrations/v046/store_test.go index f8fe4dc0cf28..c5f59c2eb2c8 100644 --- a/x/auth/migrations/v046/store_test.go +++ b/x/auth/migrations/v046/store_test.go @@ -43,9 +43,7 @@ func TestMigrateMapAccAddressToAccNumberKey(t *testing.T) { ctx := testutil.DefaultContext(storeKey, tKey) store := ctx.KVStore(storeKey) - var ( - accountKeeper keeper.AccountKeeper - ) + var accountKeeper keeper.AccountKeeper app, err := simtestutil.Setup( authtestutil.AppConfig, diff --git a/x/auth/migrations/v4/migrate.go b/x/auth/migrations/v4/migrate.go index 65e72a732a7f..3b0d0ce8cf3d 100644 --- a/x/auth/migrations/v4/migrate.go +++ b/x/auth/migrations/v4/migrate.go @@ -11,9 +11,7 @@ const ( ModuleName = "auth" ) -var ( - ParamsKey = []byte{0x01} -) +var ParamsKey = []byte{0x01} // Migrate migrates the x/auth module state from the consensus version 3 to // version 4. Specifically, it takes the parameters that are currently stored @@ -31,5 +29,4 @@ func Migrate(ctx sdk.Context, store sdk.KVStore, legacySubspace exported.Subspac store.Set(ParamsKey, bz) return nil - } diff --git a/x/crisis/keeper/keeper.go b/x/crisis/keeper/keeper.go index c806e917134f..3c191e11c19d 100644 --- a/x/crisis/keeper/keeper.go +++ b/x/crisis/keeper/keeper.go @@ -37,7 +37,6 @@ func NewKeeper( cdc codec.BinaryCodec, storeKey storetypes.StoreKey, invCheckPeriod uint, supplyKeeper types.SupplyKeeper, feeCollectorName string, authority string, ) *Keeper { - return &Keeper{ storeKey: storeKey, cdc: cdc, diff --git a/x/crisis/types/keys.go b/x/crisis/types/keys.go index 9cc09faf5808..fb936e6665de 100644 --- a/x/crisis/types/keys.go +++ b/x/crisis/types/keys.go @@ -7,6 +7,4 @@ const ( StoreKey = ModuleName ) -var ( - ConstantFeeKey = []byte{0x01} -) +var ConstantFeeKey = []byte{0x01} diff --git a/x/distribution/migrations/v3/migrate.go b/x/distribution/migrations/v3/migrate.go index f5226688bedd..d5e2f4086a07 100644 --- a/x/distribution/migrations/v3/migrate.go +++ b/x/distribution/migrations/v3/migrate.go @@ -12,9 +12,7 @@ const ( ModuleName = "distribution" ) -var ( - ParamsKey = []byte{0x09} -) +var ParamsKey = []byte{0x09} // MigrateStore migrates the x/distribution module state from the consensus version 2 to // version 3. Specifically, it takes the parameters that are currently stored diff --git a/x/feegrant/testutil/app_config.go b/x/feegrant/testutil/app_config.go index 6de28a03ba9e..05a298c79c75 100644 --- a/x/feegrant/testutil/app_config.go +++ b/x/feegrant/testutil/app_config.go @@ -18,6 +18,4 @@ import ( //go:embed app.yaml var appConfig []byte -var ( - AppConfig = appconfig.LoadYAML(appConfig) -) +var AppConfig = appconfig.LoadYAML(appConfig) diff --git a/x/mint/migrations/v2/migrate.go b/x/mint/migrations/v2/migrate.go index 2589eb3fd5c3..22f814ffc6d5 100644 --- a/x/mint/migrations/v2/migrate.go +++ b/x/mint/migrations/v2/migrate.go @@ -11,9 +11,7 @@ const ( ModuleName = "mint" ) -var ( - ParamsKey = []byte{0x01} -) +var ParamsKey = []byte{0x01} // Migrate migrates the x/mint module state from the consensus version 1 to // version 2. Specifically, it takes the parameters that are currently stored diff --git a/x/params/module.go b/x/params/module.go index 535920c6a25e..bcff2504f2cc 100644 --- a/x/params/module.go +++ b/x/params/module.go @@ -213,7 +213,7 @@ type subspaceInputs struct { func provideSubspace(in subspaceInputs) types.Subspace { moduleName := in.Key.Name() - var kt, exists = in.KeyTables[moduleName] + kt, exists := in.KeyTables[moduleName] if !exists { return in.Keeper.Subspace(moduleName) } else { diff --git a/x/slashing/keeper/keeper.go b/x/slashing/keeper/keeper.go index 89b97367507f..8fe32f9edb32 100644 --- a/x/slashing/keeper/keeper.go +++ b/x/slashing/keeper/keeper.go @@ -26,7 +26,6 @@ type Keeper struct { // NewKeeper creates a slashing keeper func NewKeeper(cdc codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key storetypes.StoreKey, sk types.StakingKeeper, authority string) Keeper { - return Keeper{ storeKey: key, cdc: cdc, diff --git a/x/slashing/migrations/v3/migrate.go b/x/slashing/migrations/v3/migrate.go index a0d79308df18..f7db99e31826 100644 --- a/x/slashing/migrations/v3/migrate.go +++ b/x/slashing/migrations/v3/migrate.go @@ -11,9 +11,7 @@ const ( ModuleName = "slashing" ) -var ( - ParamsKey = []byte{0x00} -) +var ParamsKey = []byte{0x00} // Migrate migrates the x/slashing module state from the consensus version 2 to // version 3. Specifically, it takes the parameters that are currently stored