chore: run make format (#13375)

This commit is contained in:
Jacob Gadikian 2022-09-24 05:22:03 +07:00 committed by GitHub
parent b10097fdcf
commit af816057f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 25 additions and 51 deletions

View File

@ -700,7 +700,7 @@ func BenchmarkDetailString(b *testing.B) {
PollInterval: 450 * time.Second,
PreupgradeMaxRetries: 1e7,
}
b.ReportAllocs()
b.ResetTimer()

View File

@ -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
}

View File

@ -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"

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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) {

View File

@ -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

View File

@ -9,13 +9,13 @@ import (
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
tmtime "github.com/tendermint/tendermint/types/time"
sdk "github.com/cosmos/cosmos-sdk/types"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
"github.com/cosmos/cosmos-sdk/x/auth/vesting"
"github.com/cosmos/cosmos-sdk/testutil"
sdk "github.com/cosmos/cosmos-sdk/types"
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
vestingtestutil "github.com/cosmos/cosmos-sdk/x/auth/vesting/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"
vestingtestutil "github.com/cosmos/cosmos-sdk/x/auth/vesting/testutil"
vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"
)

View File

@ -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()),

View File

@ -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())

View File

@ -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 {

View File

@ -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 {

View File

@ -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]),
},
}

View File

@ -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)

View File

@ -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),
},
}

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -107,5 +107,4 @@ func TestModuleVersionsCLI(t *testing.T) {
}
})
}
}