diff --git a/cosmovisor/args_test.go b/cosmovisor/args_test.go index 9b17fe449b20..ed7a11cfe579 100644 --- a/cosmovisor/args_test.go +++ b/cosmovisor/args_test.go @@ -700,7 +700,7 @@ func BenchmarkDetailString(b *testing.B) { PollInterval: 450 * time.Second, PreupgradeMaxRetries: 1e7, } - + b.ReportAllocs() b.ResetTimer() diff --git a/depinject/module_key.go b/depinject/module_key.go index 8fba64f9436a..dc63c28eab51 100644 --- a/depinject/module_key.go +++ b/depinject/module_key.go @@ -51,8 +51,9 @@ var ownModuleKeyType = reflect.TypeOf((*OwnModuleKey)(nil)).Elem() // not equal. // // Usage: -// moduleKeyCtx := &ModuleKeyContext{} -// fooKey := moduleKeyCtx.For("foo") +// +// moduleKeyCtx := &ModuleKeyContext{} +// fooKey := moduleKeyCtx.For("foo") type ModuleKeyContext struct { moduleKeys map[string]*moduleKey } diff --git a/orm/internal/testpb/bank.cosmos_orm.go b/orm/internal/testpb/bank.cosmos_orm.go index 0635179c20e8..51a36e5b8035 100644 --- a/orm/internal/testpb/bank.cosmos_orm.go +++ b/orm/internal/testpb/bank.cosmos_orm.go @@ -4,6 +4,7 @@ package testpb import ( context "context" + ormlist "github.com/cosmos/cosmos-sdk/orm/model/ormlist" ormtable "github.com/cosmos/cosmos-sdk/orm/model/ormtable" ormerrors "github.com/cosmos/cosmos-sdk/orm/types/ormerrors" diff --git a/orm/internal/testpb/test_schema.cosmos_orm.go b/orm/internal/testpb/test_schema.cosmos_orm.go index a5cf2a6fbd11..0306c97c8c56 100644 --- a/orm/internal/testpb/test_schema.cosmos_orm.go +++ b/orm/internal/testpb/test_schema.cosmos_orm.go @@ -4,6 +4,7 @@ package testpb import ( context "context" + ormlist "github.com/cosmos/cosmos-sdk/orm/model/ormlist" ormtable "github.com/cosmos/cosmos-sdk/orm/model/ormtable" ormerrors "github.com/cosmos/cosmos-sdk/orm/types/ormerrors" diff --git a/orm/internal/testutil/testutil.go b/orm/internal/testutil/testutil.go index a4856eb1a0bc..13556fdd0dc4 100644 --- a/orm/internal/testutil/testutil.go +++ b/orm/internal/testutil/testutil.go @@ -169,7 +169,6 @@ func (k TestKeyCodec) Draw(t *rapid.T, id string) []protoreflect.Value { n := len(k.KeySpecs) keyValues := make([]protoreflect.Value, n) for i, k := range k.KeySpecs { - keyValues[i] = protoreflect.ValueOf(k.Gen.Draw(t, fmt.Sprintf("%s[%d]", id, i))) } return keyValues diff --git a/tests/e2e/server/export_test.go b/tests/e2e/server/export_test.go index a90cf1e704c3..633106e61473 100644 --- a/tests/e2e/server/export_test.go +++ b/tests/e2e/server/export_test.go @@ -22,11 +22,11 @@ import ( tmtypes "github.com/tendermint/tendermint/types" dbm "github.com/tendermint/tm-db" + "cosmossdk.io/simapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/server/types" - "cosmossdk.io/simapp" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/genutil" diff --git a/tests/integration/bank/keeper/keeper_test.go b/tests/integration/bank/keeper/keeper_test.go index 7bb721a69ba0..dac872d0ae49 100644 --- a/tests/integration/bank/keeper/keeper_test.go +++ b/tests/integration/bank/keeper/keeper_test.go @@ -26,8 +26,8 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmtime "github.com/tendermint/tendermint/types/time" - "github.com/cosmos/cosmos-sdk/baseapp" "cosmossdk.io/simapp" + "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" diff --git a/tests/integration/staking/keeper/common_test.go b/tests/integration/staking/keeper/common_test.go index b8714c100418..39e1cbab111a 100644 --- a/tests/integration/staking/keeper/common_test.go +++ b/tests/integration/staking/keeper/common_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/codec" "cosmossdk.io/simapp" + "github.com/cosmos/cosmos-sdk/codec" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" diff --git a/tests/integration/staking/keeper/genesis_test.go b/tests/integration/staking/keeper/genesis_test.go index 96efcca81bc1..db759e73cc86 100644 --- a/tests/integration/staking/keeper/genesis_test.go +++ b/tests/integration/staking/keeper/genesis_test.go @@ -9,8 +9,8 @@ import ( abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" "cosmossdk.io/simapp" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/staking" diff --git a/tests/integration/staking/keeper/keeper_test.go b/tests/integration/staking/keeper/keeper_test.go index 59c341b73e11..53f075452853 100644 --- a/tests/integration/staking/keeper/keeper_test.go +++ b/tests/integration/staking/keeper/keeper_test.go @@ -8,8 +8,8 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/baseapp" "cosmossdk.io/simapp" + "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/types" diff --git a/tests/integration/staking/keeper/validator_test.go b/tests/integration/staking/keeper/validator_test.go index 6d7315410a86..5190e4135666 100644 --- a/tests/integration/staking/keeper/validator_test.go +++ b/tests/integration/staking/keeper/validator_test.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "cosmossdk.io/simapp" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/bank/testutil" diff --git a/tx/textual/valuerenderer/coins.go b/tx/textual/valuerenderer/coins.go index 0b3b302dd938..f369777bb37e 100644 --- a/tx/textual/valuerenderer/coins.go +++ b/tx/textual/valuerenderer/coins.go @@ -78,7 +78,6 @@ func (vr coinsValueRenderer) Format(ctx context.Context, v protoreflect.Value, w default: return fmt.Errorf("got invalid type %t for coins", v.Interface()) } - } func (vr coinsValueRenderer) Parse(_ context.Context, r io.Reader) (protoreflect.Value, error) { diff --git a/x/auth/keeper/deterministic_test.go b/x/auth/keeper/deterministic_test.go index 471b0956b6d8..f36a44a85d51 100644 --- a/x/auth/keeper/deterministic_test.go +++ b/x/auth/keeper/deterministic_test.go @@ -21,7 +21,7 @@ import ( type DeterministicTestSuite struct { suite.Suite - ctx sdk.Context + ctx sdk.Context queryClient types.QueryClient accountKeeper keeper.AccountKeeper encCfg moduletestutil.TestEncodingConfig diff --git a/x/auth/vesting/msg_server_test.go b/x/auth/vesting/msg_server_test.go index 574b4120021b..300d48c995dc 100644 --- a/x/auth/vesting/msg_server_test.go +++ b/x/auth/vesting/msg_server_test.go @@ -9,13 +9,13 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmtime "github.com/tendermint/tendermint/types/time" + "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/auth/vesting" - "github.com/cosmos/cosmos-sdk/testutil" - moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" vestingtestutil "github.com/cosmos/cosmos-sdk/x/auth/vesting/testutil" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" ) diff --git a/x/feegrant/client/cli/tx_test.go b/x/feegrant/client/cli/tx_test.go index 4f33f9709058..beaa0a45f362 100644 --- a/x/feegrant/client/cli/tx_test.go +++ b/x/feegrant/client/cli/tx_test.go @@ -635,8 +635,7 @@ func (s *CLITestSuite) TestTxWithFeeGrant() { } func (s *CLITestSuite) msgSubmitLegacyProposal(clientCtx client.Context, from, title, description, proposalType string, extraArgs ...string) error { - - var commonArgs = []string{ + commonArgs := []string{ fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), @@ -813,7 +812,7 @@ func (s *CLITestSuite) TestFilteredFeeAllowance() { // msgVote votes for a proposal func (s *CLITestSuite) msgVote(clientCtx client.Context, from, id, vote string, extraArgs ...string) error { - var commonArgs = []string{ + commonArgs := []string{ fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), diff --git a/x/genutil/client/cli/gentx_test.go b/x/genutil/client/cli/gentx_test.go index 3fc106ee785d..2ffde26a8484 100644 --- a/x/genutil/client/cli/gentx_test.go +++ b/x/genutil/client/cli/gentx_test.go @@ -87,7 +87,6 @@ func (s *CLITestSuite) SetupSuite() { return s.baseCtx.WithClient(c) } s.clientCtx = ctxGen().WithOutput(&outBuf) - } func (s *CLITestSuite) TestGenTxCmd() { @@ -147,7 +146,6 @@ func (s *CLITestSuite) TestGenTxCmd() { tc.args = append(tc.args, fmt.Sprintf("--%s=%s", flags.FlagOutputDocument, genTxFile)) s.Run(tc.name, func() { - clientCtx := s.clientCtx ctx := svrcmd.CreateExecuteContext(context.Background()) diff --git a/x/genutil/client/cli/migrate_test.go b/x/genutil/client/cli/migrate_test.go index 0740a04ee801..cb873aaede77 100644 --- a/x/genutil/client/cli/migrate_test.go +++ b/x/genutil/client/cli/migrate_test.go @@ -46,7 +46,6 @@ func (s *CLITestSuite) TestMigrateGenesis() { for _, tc := range testCases { tc := tc s.Run(tc.name, func() { - genesisFile := testutil.WriteToNewTempFile(s.T(), tc.genesis) jsonOutput, err := clitestutil.ExecTestCLICmd(s.clientCtx, cli.MigrateGenesisCmd(), []string{tc.target, genesisFile.Name()}) if tc.expErr { diff --git a/x/genutil/client/cli/validate_genesis_test.go b/x/genutil/client/cli/validate_genesis_test.go index f981f172b8e8..feec463f9d68 100644 --- a/x/genutil/client/cli/validate_genesis_test.go +++ b/x/genutil/client/cli/validate_genesis_test.go @@ -87,7 +87,6 @@ func (s *CLITestSuite) TestValidateGenesis() { for _, tc := range testCases { tc := tc s.Run(tc.name, func() { - genesisFile := testutil.WriteToNewTempFile(s.T(), tc.genesis) _, err := clitestutil.ExecTestCLICmd(s.clientCtx, cli.ValidateGenesisCmd(nil), []string{genesisFile.Name()}) if tc.expErr { diff --git a/x/gov/types/v1/msgs_test.go b/x/gov/types/v1/msgs_test.go index 6d0d8ed7f040..4ea6f96b1c29 100644 --- a/x/gov/types/v1/msgs_test.go +++ b/x/gov/types/v1/msgs_test.go @@ -178,11 +178,13 @@ func TestMsgSubmitProposal_GetSignBytes(t *testing.T) { expSignBz string }{ { - "MsgVote", []sdk.Msg{v1.NewMsgVote(addrs[0], 1, v1.OptionYes, "")}, + "MsgVote", + []sdk.Msg{v1.NewMsgVote(addrs[0], 1, v1.OptionYes, "")}, `{"type":"cosmos-sdk/v1/MsgSubmitProposal","value":{"initial_deposit":[],"messages":[{"type":"cosmos-sdk/v1/MsgVote","value":{"option":1,"proposal_id":"1","voter":"cosmos1w3jhxap3gempvr"}}]}}`, }, { - "MsgSend", []sdk.Msg{banktypes.NewMsgSend(addrs[0], addrs[0], sdk.NewCoins())}, + "MsgSend", + []sdk.Msg{banktypes.NewMsgSend(addrs[0], addrs[0], sdk.NewCoins())}, fmt.Sprintf(`{"type":"cosmos-sdk/v1/MsgSubmitProposal","value":{"initial_deposit":[],"messages":[{"type":"cosmos-sdk/MsgSend","value":{"amount":[],"from_address":"%s","to_address":"%s"}}]}}`, addrs[0], addrs[0]), }, } diff --git a/x/group/client/cli/tx_test.go b/x/group/client/cli/tx_test.go index 1ad4975e7bdf..5c37759f47e3 100644 --- a/x/group/client/cli/tx_test.go +++ b/x/group/client/cli/tx_test.go @@ -286,7 +286,6 @@ func (s *CLITestSuite) TestTxCreateGroup() { tc := tc s.Run(tc.name, func() { - var outBuf bytes.Buffer clientCtx := tc.ctxGen().WithOutput(&outBuf) @@ -541,7 +540,6 @@ func (s *CLITestSuite) TestTxUpdateGroupMetadata() { tc := tc s.Run(tc.name, func() { - var outBuf bytes.Buffer clientCtx := tc.ctxGen().WithOutput(&outBuf) @@ -674,7 +672,6 @@ func (s *CLITestSuite) TestTxUpdateGroupMembers() { tc := tc s.Run(tc.name, func() { - var outBuf bytes.Buffer clientCtx := tc.ctxGen().WithOutput(&outBuf) @@ -859,7 +856,6 @@ func (s *CLITestSuite) TestTxCreateGroupWithPolicy() { tc := tc s.Run(tc.name, func() { - var outBuf bytes.Buffer clientCtx := tc.ctxGen().WithOutput(&outBuf) @@ -1055,7 +1051,6 @@ func (s *CLITestSuite) TestTxCreateGroupPolicy() { tc := tc s.Run(tc.name, func() { - var outBuf bytes.Buffer clientCtx := tc.ctxGen().WithOutput(&outBuf) @@ -1183,7 +1178,6 @@ func (s *CLITestSuite) TestTxUpdateGroupPolicyAdmin() { tc := tc s.Run(tc.name, func() { - var outBuf bytes.Buffer clientCtx := tc.ctxGen().WithOutput(&outBuf) @@ -1364,7 +1358,6 @@ func (s *CLITestSuite) TestTxUpdateGroupPolicyDecisionPolicy() { tc := tc s.Run(tc.name, func() { - var outBuf bytes.Buffer clientCtx := tc.ctxGen().WithOutput(&outBuf) @@ -1380,7 +1373,6 @@ func (s *CLITestSuite) TestTxUpdateGroupPolicyDecisionPolicy() { } }) } - } func (s *CLITestSuite) TestTxUpdateGroupPolicyMetadata() { @@ -1502,7 +1494,6 @@ func (s *CLITestSuite) TestTxUpdateGroupPolicyMetadata() { tc := tc s.Run(tc.name, func() { - var outBuf bytes.Buffer clientCtx := tc.ctxGen().WithOutput(&outBuf) @@ -1620,7 +1611,6 @@ func (s *CLITestSuite) TestTxSubmitProposal() { tc := tc s.Run(tc.name, func() { - var outBuf bytes.Buffer clientCtx := tc.ctxGen().WithOutput(&outBuf) @@ -1743,7 +1733,6 @@ func (s *CLITestSuite) TestTxVote() { tc := tc s.Run(tc.name, func() { - var outBuf bytes.Buffer clientCtx := tc.ctxGen().WithOutput(&outBuf) @@ -1819,7 +1808,6 @@ func (s *CLITestSuite) TestTxWithdrawProposal() { tc := tc s.Run(tc.name, func() { - var outBuf bytes.Buffer clientCtx := tc.ctxGen().WithOutput(&outBuf) diff --git a/x/group/msgs_test.go b/x/group/msgs_test.go index 046044b591d5..2e528ada3c22 100644 --- a/x/group/msgs_test.go +++ b/x/group/msgs_test.go @@ -971,7 +971,8 @@ func TestMsgSubmitProposalGetSignBytes(t *testing.T) { expSignBz string }{ { - "MsgSend", []sdk.Msg{banktypes.NewMsgSend(member1, member1, sdk.NewCoins())}, + "MsgSend", + []sdk.Msg{banktypes.NewMsgSend(member1, member1, sdk.NewCoins())}, fmt.Sprintf(`{"type":"cosmos-sdk/group/MsgSubmitProposal","value":{"messages":[{"type":"cosmos-sdk/MsgSend","value":{"amount":[],"from_address":"%s","to_address":"%s"}}],"proposers":[""]}}`, member1, member1), }, } diff --git a/x/nft/client/cli/tx_test.go b/x/nft/client/cli/tx_test.go index 0cc85e642ae5..bba4c6a08415 100644 --- a/x/nft/client/cli/tx_test.go +++ b/x/nft/client/cli/tx_test.go @@ -181,7 +181,6 @@ func (s *CLITestSuite) TestCLITxSend() { for _, tc := range testCases { tc := tc s.Run(tc.name, func() { - args = append(args, tc.args...) cmd := cli.NewCmdSend() cmd.SetContext(s.ctx) diff --git a/x/slashing/client/cli/query_test.go b/x/slashing/client/cli/query_test.go index d380e4f36037..cbadc7e81cad 100644 --- a/x/slashing/client/cli/query_test.go +++ b/x/slashing/client/cli/query_test.go @@ -104,7 +104,6 @@ func (s *CLITestSuite) SetupSuite() { } func (s *CLITestSuite) TestGetCmdQuerySigningInfo() { - pubKeyBz, err := s.encCfg.Codec.MarshalInterfaceJSON(s.pub) s.Require().NoError(err) pubKeyStr := string(pubKeyBz) @@ -153,7 +152,6 @@ func (s *CLITestSuite) TestGetCmdQuerySigningInfo() { } func (s *CLITestSuite) TestGetCmdQueryParams() { - testCases := []struct { name string args []string diff --git a/x/staking/client/cli/query_test.go b/x/staking/client/cli/query_test.go index b935f2e6bd07..36fc37281ba7 100644 --- a/x/staking/client/cli/query_test.go +++ b/x/staking/client/cli/query_test.go @@ -49,7 +49,6 @@ func (s *CLITestSuite) TestGetCmdQueryValidator() { } func (s *CLITestSuite) TestGetCmdQueryValidators() { - testCases := []struct { name string args []string @@ -140,7 +139,6 @@ func (s *CLITestSuite) TestGetCmdQueryDelegation() { } func (s *CLITestSuite) TestGetCmdQueryDelegations() { - testCases := []struct { name string args []string @@ -187,7 +185,6 @@ func (s *CLITestSuite) TestGetCmdQueryDelegations() { } func (s *CLITestSuite) TestGetCmdQueryValidatorDelegations() { - testCases := []struct { name string args []string @@ -234,7 +231,6 @@ func (s *CLITestSuite) TestGetCmdQueryValidatorDelegations() { } func (s *CLITestSuite) TestGetCmdQueryUnbondingDelegations() { - testCases := []struct { name string args []string @@ -279,7 +275,6 @@ func (s *CLITestSuite) TestGetCmdQueryUnbondingDelegations() { } func (s *CLITestSuite) TestGetCmdQueryUnbondingDelegation() { - testCases := []struct { name string args []string @@ -335,7 +330,6 @@ func (s *CLITestSuite) TestGetCmdQueryUnbondingDelegation() { } func (s *CLITestSuite) TestGetCmdQueryValidatorUnbondingDelegations() { - testCases := []struct { name string args []string @@ -533,7 +527,6 @@ func (s *CLITestSuite) TestGetCmdQueryValidatorRedelegations() { } func (s *CLITestSuite) TestGetCmdQueryPool() { - testCases := []struct { name string args []string diff --git a/x/staking/client/cli/tx_test.go b/x/staking/client/cli/tx_test.go index e39a70e6f9c8..cb71d1595c29 100644 --- a/x/staking/client/cli/tx_test.go +++ b/x/staking/client/cli/tx_test.go @@ -100,7 +100,6 @@ func (s *CLITestSuite) SetupSuite() { newAddr := sdk.AccAddress(pub.Address()) s.addrs = append(s.addrs, newAddr) } - } func (s *CLITestSuite) TestPrepareConfigForTxCreateValidator() { @@ -403,7 +402,6 @@ func (s *CLITestSuite) TestNewEditValidatorCmd() { tc := tc s.Run(tc.name, func() { - out, err := clitestutil.ExecTestCLICmd(s.clientCtx, cmd, tc.args) if tc.expectErr { s.Require().Error(err) diff --git a/x/upgrade/client/cli/tx_test.go b/x/upgrade/client/cli/tx_test.go index 2de13e1fb62a..76036c7505e6 100644 --- a/x/upgrade/client/cli/tx_test.go +++ b/x/upgrade/client/cli/tx_test.go @@ -107,5 +107,4 @@ func TestModuleVersionsCLI(t *testing.T) { } }) } - }