From f740c3e25695891d927ce136500c9a799c46a94b Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Mon, 10 Jul 2023 16:46:00 +0800 Subject: [PATCH] refactor: sort imports with gci (#1034) apply gci linter --- .golangci.yml | 13 ++- .../ante/forbidden_proposals_ante.go | 1 - .../ante/forbidden_proposals_ante_test.go | 7 +- app/consumer-democracy/ante_handler.go | 7 +- app/consumer-democracy/app.go | 94 +++++++++---------- app/consumer-democracy/export.go | 6 +- .../proposals_whitelisting.go | 3 +- .../proposals_whitelisting_test.go | 3 +- .../ante/disabled_modules_ante_test.go | 6 +- app/consumer/ante/msg_filter_ante_test.go | 6 +- app/consumer/ante_handler.go | 6 +- app/consumer/app.go | 42 ++++----- app/consumer/export.go | 6 +- app/provider/ante_handler.go | 6 +- app/provider/app.go | 47 +++++----- app/provider/export.go | 4 +- app/sovereign/ante_handler.go | 6 +- app/sovereign/app.go | 86 ++++++++--------- app/sovereign/export.go | 4 +- cmd/interchain-security-cd/cmd/root.go | 13 ++- cmd/interchain-security-cd/main.go | 1 + cmd/interchain-security-cdd/cmd/root.go | 10 +- cmd/interchain-security-cdd/main.go | 1 + cmd/interchain-security-pd/cmd/root.go | 11 ++- cmd/interchain-security-pd/main.go | 1 + cmd/interchain-security-sd/cmd/root.go | 11 ++- cmd/interchain-security-sd/main.go | 1 + tests/difference/core/driver/common.go | 5 +- tests/difference/core/driver/core_test.go | 14 ++- .../core/driver/seed_gen_fuzzy_test.go | 7 +- tests/difference/core/driver/setup.go | 34 ++++--- tests/e2e/actions.go | 5 +- tests/integration/common.go | 20 ++-- tests/integration/democracy.go | 10 +- tests/integration/distribution.go | 3 +- tests/integration/expired_client.go | 10 +- tests/integration/instance_test.go | 3 +- tests/integration/key_assignment.go | 8 +- tests/integration/normal_operations.go | 4 +- tests/integration/setup.go | 18 ++-- tests/integration/slashing.go | 12 ++- tests/integration/stop_consumer.go | 6 +- tests/integration/throttle.go | 6 +- tests/integration/unbonding.go | 1 + tests/integration/valset_update.go | 9 +- x/ccv/consumer/client/cli/query.go | 1 + x/ccv/consumer/ibc_module.go | 12 +-- x/ccv/consumer/ibc_module_test.go | 11 ++- x/ccv/consumer/keeper/changeover.go | 3 +- x/ccv/consumer/keeper/changeover_test.go | 9 +- x/ccv/consumer/keeper/distribution.go | 7 +- x/ccv/consumer/keeper/distribution_test.go | 5 +- x/ccv/consumer/keeper/genesis.go | 5 +- x/ccv/consumer/keeper/genesis_test.go | 20 ++-- x/ccv/consumer/keeper/grpc_query.go | 6 +- x/ccv/consumer/keeper/hooks.go | 1 + x/ccv/consumer/keeper/keeper.go | 15 +-- x/ccv/consumer/keeper/keeper_test.go | 14 +-- x/ccv/consumer/keeper/params_test.go | 3 +- x/ccv/consumer/keeper/relay.go | 11 ++- x/ccv/consumer/keeper/relay_test.go | 16 ++-- x/ccv/consumer/keeper/soft_opt_out.go | 1 + x/ccv/consumer/keeper/soft_opt_out_test.go | 4 +- x/ccv/consumer/keeper/validators.go | 6 +- x/ccv/consumer/keeper/validators_test.go | 12 ++- x/ccv/consumer/module.go | 9 +- x/ccv/consumer/types/genesis.go | 4 +- x/ccv/consumer/types/genesis_test.go | 12 +-- x/ccv/consumer/types/keys.go | 1 + x/ccv/consumer/types/params.go | 1 + x/ccv/consumer/types/validator.go | 1 + x/ccv/democracy/distribution/module.go | 8 +- x/ccv/democracy/governance/module.go | 4 +- x/ccv/democracy/staking/module.go | 3 +- x/ccv/provider/client/cli/tx.go | 2 +- x/ccv/provider/client/proposal_handler.go | 6 +- x/ccv/provider/handler.go | 2 + x/ccv/provider/handler_test.go | 4 +- x/ccv/provider/ibc_module.go | 11 ++- x/ccv/provider/ibc_module_test.go | 13 ++- x/ccv/provider/keeper/distribution.go | 1 + x/ccv/provider/keeper/distribution_test.go | 6 +- x/ccv/provider/keeper/genesis.go | 1 + x/ccv/provider/keeper/genesis_test.go | 9 +- x/ccv/provider/keeper/grpc_query.go | 7 +- x/ccv/provider/keeper/hooks.go | 2 +- x/ccv/provider/keeper/hooks_test.go | 4 +- x/ccv/provider/keeper/keeper.go | 17 ++-- x/ccv/provider/keeper/keeper_test.go | 7 +- x/ccv/provider/keeper/key_assignment.go | 7 +- x/ccv/provider/keeper/key_assignment_test.go | 12 ++- x/ccv/provider/keeper/msg_server.go | 6 +- x/ccv/provider/keeper/params.go | 4 +- x/ccv/provider/keeper/params_test.go | 5 +- x/ccv/provider/keeper/proposal.go | 12 ++- x/ccv/provider/keeper/proposal_test.go | 9 +- x/ccv/provider/keeper/relay.go | 8 +- x/ccv/provider/keeper/relay_test.go | 15 +-- x/ccv/provider/keeper/throttle.go | 4 +- x/ccv/provider/keeper/throttle_test.go | 9 +- x/ccv/provider/module.go | 12 +-- x/ccv/provider/module_test.go | 11 +-- x/ccv/provider/proposal_handler.go | 5 +- x/ccv/provider/proposal_handler_test.go | 9 +- x/ccv/provider/types/genesis.go | 4 +- x/ccv/provider/types/genesis_test.go | 11 ++- x/ccv/provider/types/key_assignment.go | 2 + x/ccv/provider/types/keys_test.go | 4 +- x/ccv/provider/types/params.go | 6 +- x/ccv/provider/types/params_test.go | 7 +- x/ccv/provider/types/proposal.go | 4 +- x/ccv/provider/types/proposal_test.go | 8 +- x/ccv/types/ccv.go | 4 +- x/ccv/types/ccv_test.go | 7 +- x/ccv/types/expected_keepers.go | 12 ++- x/ccv/types/shared_params.go | 3 +- x/ccv/types/utils.go | 13 ++- x/ccv/types/utils_test.go | 7 +- 118 files changed, 612 insertions(+), 482 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 430440a76f..5a3b555a6d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -10,9 +10,9 @@ run: linters: disable-all: true enable: - - depguard - dogsled - exportloopref + - gci - goconst - gocritic - gofumpt @@ -60,6 +60,17 @@ issues: max-same-issues: 10000 linters-settings: + gci: + sections: + - standard # Standard section: captures all standard packages. + - default # Default section: contains all imports that could not be matched to another section type. + - blank # blank imports + - dot # dot imports + - prefix(cosmossdk.io) + - prefix(github.com/cosmos/cosmos-sdk) + - prefix(github.com/cometbft/cometbft) + - prefix(github.com/cosmos/interchain-security) + custom-order: true gofumpt: # Choose whether to use the extra rules. # Default: false diff --git a/app/consumer-democracy/ante/forbidden_proposals_ante.go b/app/consumer-democracy/ante/forbidden_proposals_ante.go index f8acfd8bc5..2856aa4e5b 100644 --- a/app/consumer-democracy/ante/forbidden_proposals_ante.go +++ b/app/consumer-democracy/ante/forbidden_proposals_ante.go @@ -4,7 +4,6 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) diff --git a/app/consumer-democracy/ante/forbidden_proposals_ante_test.go b/app/consumer-democracy/ante/forbidden_proposals_ante_test.go index bbe9f6a5dd..0b17e1a0b7 100644 --- a/app/consumer-democracy/ante/forbidden_proposals_ante_test.go +++ b/app/consumer-democracy/ante/forbidden_proposals_ante_test.go @@ -3,6 +3,9 @@ package ante_test import ( "testing" + ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" @@ -10,11 +13,9 @@ import ( govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/cosmos/cosmos-sdk/x/params/types/proposal" + app "github.com/cosmos/interchain-security/v3/app/consumer-democracy" "github.com/cosmos/interchain-security/v3/app/consumer-democracy/ante" - "github.com/stretchr/testify/require" - - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" ) // in SDKv47 parameter updates full params object is required diff --git a/app/consumer-democracy/ante_handler.go b/app/consumer-democracy/ante_handler.go index e27986a482..eff1a5b1c7 100644 --- a/app/consumer-democracy/ante_handler.go +++ b/app/consumer-democracy/ante_handler.go @@ -1,12 +1,15 @@ package app import ( + ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" + ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/auth/ante" - ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + democracyante "github.com/cosmos/interchain-security/v3/app/consumer-democracy/ante" consumerante "github.com/cosmos/interchain-security/v3/app/consumer/ante" ibcconsumerkeeper "github.com/cosmos/interchain-security/v3/x/ccv/consumer/keeper" diff --git a/app/consumer-democracy/app.go b/app/consumer-democracy/app.go index 6b3078212b..063c5bf427 100644 --- a/app/consumer-democracy/app.go +++ b/app/consumer-democracy/app.go @@ -7,23 +7,29 @@ import ( "os" "path/filepath" - "github.com/cosmos/cosmos-sdk/client/flags" - nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node" - "github.com/cosmos/cosmos-sdk/runtime" - "github.com/cosmos/cosmos-sdk/x/consensus" - consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" - consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" - "github.com/cosmos/cosmos-sdk/x/genutil" - genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - appparams "github.com/cosmos/interchain-security/v3/app/params" + "github.com/cosmos/ibc-go/v7/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v7/modules/core" + ibcconnectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" + porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" + ibchost "github.com/cosmos/ibc-go/v7/modules/core/exported" + ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + tendermint "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + "github.com/spf13/cast" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node" "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/runtime" + runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/server/api" "github.com/cosmos/cosmos-sdk/server/config" @@ -45,77 +51,67 @@ import ( authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module" "github.com/cosmos/cosmos-sdk/x/bank" - - runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/capability" capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + "github.com/cosmos/cosmos-sdk/x/consensus" + consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" + consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" "github.com/cosmos/cosmos-sdk/x/crisis" crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" + distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" "github.com/cosmos/cosmos-sdk/x/evidence" evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper" evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" "github.com/cosmos/cosmos-sdk/x/feegrant" feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module" + "github.com/cosmos/cosmos-sdk/x/genutil" + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" + gov "github.com/cosmos/cosmos-sdk/x/gov" + govclient "github.com/cosmos/cosmos-sdk/x/gov/client" + govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + // add mint + mint "github.com/cosmos/cosmos-sdk/x/mint" + mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/cosmos/cosmos-sdk/x/params" paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" + "github.com/cosmos/cosmos-sdk/x/slashing" + slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/cosmos/cosmos-sdk/x/upgrade" upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" + upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" dbm "github.com/cometbft/cometbft-db" abci "github.com/cometbft/cometbft/abci/types" tmjson "github.com/cometbft/cometbft/libs/json" "github.com/cometbft/cometbft/libs/log" tmos "github.com/cometbft/cometbft/libs/os" - "github.com/cosmos/cosmos-sdk/x/slashing" - slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" - slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - "github.com/cosmos/cosmos-sdk/x/upgrade" - upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/cosmos/ibc-go/v7/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v7/modules/core" - ibcconnectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - ibchost "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + + appparams "github.com/cosmos/interchain-security/v3/app/params" ibctestingcore "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/core" ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing" - "github.com/spf13/cast" - - distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" - distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" testutil "github.com/cosmos/interchain-security/v3/testutil/integration" - ccvdistr "github.com/cosmos/interchain-security/v3/x/ccv/democracy/distribution" - - stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - ccvstaking "github.com/cosmos/interchain-security/v3/x/ccv/democracy/staking" - - gov "github.com/cosmos/cosmos-sdk/x/gov" - govclient "github.com/cosmos/cosmos-sdk/x/gov/client" - govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - ccvgov "github.com/cosmos/interchain-security/v3/x/ccv/democracy/governance" - - // add mint - mint "github.com/cosmos/cosmos-sdk/x/mint" - mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - - paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" - tendermint "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" consumer "github.com/cosmos/interchain-security/v3/x/ccv/consumer" consumerkeeper "github.com/cosmos/interchain-security/v3/x/ccv/consumer/keeper" consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" + ccvdistr "github.com/cosmos/interchain-security/v3/x/ccv/democracy/distribution" + ccvgov "github.com/cosmos/interchain-security/v3/x/ccv/democracy/governance" + ccvstaking "github.com/cosmos/interchain-security/v3/x/ccv/democracy/staking" ) const ( diff --git a/app/consumer-democracy/export.go b/app/consumer-democracy/export.go index 6c511d6871..bb710da1c4 100644 --- a/app/consumer-democracy/export.go +++ b/app/consumer-democracy/export.go @@ -4,12 +4,12 @@ import ( "encoding/json" "fmt" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - - tmtypes "github.com/cometbft/cometbft/types" servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtypes "github.com/cometbft/cometbft/types" ) // ExportAppStateAndValidators exports the state of the application for a genesis diff --git a/app/consumer-democracy/proposals_whitelisting.go b/app/consumer-democracy/proposals_whitelisting.go index ab9114343f..1e9141895c 100644 --- a/app/consumer-democracy/proposals_whitelisting.go +++ b/app/consumer-democracy/proposals_whitelisting.go @@ -1,9 +1,10 @@ package app import ( + ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/params/types/proposal" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" ) func IsProposalWhitelisted(content v1beta1.Content) bool { diff --git a/app/consumer-democracy/proposals_whitelisting_test.go b/app/consumer-democracy/proposals_whitelisting_test.go index a51709ae4a..127ec82ec5 100644 --- a/app/consumer-democracy/proposals_whitelisting_test.go +++ b/app/consumer-democracy/proposals_whitelisting_test.go @@ -3,10 +3,11 @@ package app_test import ( "testing" + "github.com/stretchr/testify/require" + appConsumer "github.com/cosmos/interchain-security/v3/app/consumer-democracy" ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing" icstestingutils "github.com/cosmos/interchain-security/v3/testutil/ibc_testing" - "github.com/stretchr/testify/require" ) func TestDemocracyGovernanceWhitelistingKeys(t *testing.T) { diff --git a/app/consumer/ante/disabled_modules_ante_test.go b/app/consumer/ante/disabled_modules_ante_test.go index dd58e8b79e..1fa114f00c 100644 --- a/app/consumer/ante/disabled_modules_ante_test.go +++ b/app/consumer/ante/disabled_modules_ante_test.go @@ -3,14 +3,16 @@ package ante_test import ( "testing" + ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + "github.com/cosmos/interchain-security/v3/app/consumer/ante" "github.com/cosmos/interchain-security/v3/app/params" - "github.com/stretchr/testify/require" ) func TestDisabledModulesDecorator(t *testing.T) { diff --git a/app/consumer/ante/msg_filter_ante_test.go b/app/consumer/ante/msg_filter_ante_test.go index 76b3dec604..04bc838a8a 100644 --- a/app/consumer/ante/msg_filter_ante_test.go +++ b/app/consumer/ante/msg_filter_ante_test.go @@ -3,12 +3,14 @@ package ante_test import ( "testing" + ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + "github.com/cosmos/interchain-security/v3/app/consumer/ante" "github.com/cosmos/interchain-security/v3/app/params" - "github.com/stretchr/testify/require" ) type consumerKeeper struct { diff --git a/app/consumer/ante_handler.go b/app/consumer/ante_handler.go index f963150626..d251966685 100644 --- a/app/consumer/ante_handler.go +++ b/app/consumer/ante_handler.go @@ -1,12 +1,14 @@ package app import ( + ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" + ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/auth/ante" - ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" consumerante "github.com/cosmos/interchain-security/v3/app/consumer/ante" ibcconsumerkeeper "github.com/cosmos/interchain-security/v3/x/ccv/consumer/keeper" diff --git a/app/consumer/app.go b/app/consumer/app.go index 17c15c2c86..c65447e244 100644 --- a/app/consumer/app.go +++ b/app/consumer/app.go @@ -7,14 +7,20 @@ import ( "os" "path/filepath" + "github.com/cosmos/ibc-go/v7/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v7/modules/core" + ibcconnectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" + porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" + ibchost "github.com/cosmos/ibc-go/v7/modules/core/exported" + ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + tendermint "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + "github.com/spf13/cast" + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" - dbm "github.com/cometbft/cometbft-db" - abci "github.com/cometbft/cometbft/abci/types" - tmjson "github.com/cometbft/cometbft/libs/json" - "github.com/cometbft/cometbft/libs/log" - tmos "github.com/cometbft/cometbft/libs/os" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" @@ -35,9 +41,6 @@ import ( "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/auth" "github.com/cosmos/cosmos-sdk/x/auth/ante" - "github.com/cosmos/cosmos-sdk/x/genutil" - genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" @@ -63,6 +66,8 @@ import ( "github.com/cosmos/cosmos-sdk/x/feegrant" feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module" + "github.com/cosmos/cosmos-sdk/x/genutil" + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/params" paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" @@ -73,25 +78,20 @@ import ( "github.com/cosmos/cosmos-sdk/x/upgrade" upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/cosmos/ibc-go/v7/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v7/modules/core" - ibcconnectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - ibchost "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + + dbm "github.com/cometbft/cometbft-db" + abci "github.com/cometbft/cometbft/abci/types" + tmjson "github.com/cometbft/cometbft/libs/json" + "github.com/cometbft/cometbft/libs/log" + tmos "github.com/cometbft/cometbft/libs/os" + appparams "github.com/cosmos/interchain-security/v3/app/params" ibctestingcore "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/core" ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing" - "github.com/spf13/cast" - - tendermint "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + testutil "github.com/cosmos/interchain-security/v3/testutil/integration" ibcconsumer "github.com/cosmos/interchain-security/v3/x/ccv/consumer" ibcconsumerkeeper "github.com/cosmos/interchain-security/v3/x/ccv/consumer/keeper" ibcconsumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" - - testutil "github.com/cosmos/interchain-security/v3/testutil/integration" ) const ( diff --git a/app/consumer/export.go b/app/consumer/export.go index 168e5385a1..4260efda92 100644 --- a/app/consumer/export.go +++ b/app/consumer/export.go @@ -4,12 +4,12 @@ import ( "encoding/json" "fmt" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - - tmtypes "github.com/cometbft/cometbft/types" servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtypes "github.com/cometbft/cometbft/types" ) // ExportAppStateAndValidators implements the simapp app interface diff --git a/app/provider/ante_handler.go b/app/provider/ante_handler.go index 0a71573b07..9ba33d3264 100644 --- a/app/provider/ante_handler.go +++ b/app/provider/ante_handler.go @@ -1,12 +1,14 @@ package app import ( + ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" + ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/auth/ante" - ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" ) // HandlerOptions extend the SDK's AnteHandler options by requiring the IBC diff --git a/app/provider/app.go b/app/provider/app.go index a307834d7b..c295199ca0 100644 --- a/app/provider/app.go +++ b/app/provider/app.go @@ -7,22 +7,33 @@ import ( "os" "path/filepath" - "github.com/cosmos/cosmos-sdk/client/flags" - nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node" - "github.com/cosmos/cosmos-sdk/runtime" - "github.com/cosmos/cosmos-sdk/server" + "github.com/cosmos/ibc-go/v7/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v7/modules/core" + ibcclient "github.com/cosmos/ibc-go/v7/modules/core/02-client" + ibcclientclient "github.com/cosmos/ibc-go/v7/modules/core/02-client/client" + ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + ibcconnectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" + porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" + ibchost "github.com/cosmos/ibc-go/v7/modules/core/exported" + ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + tendermint "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + "github.com/spf13/cast" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" - appparams "github.com/cosmos/interchain-security/v3/app/params" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node" "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" "github.com/cosmos/cosmos-sdk/codec" - runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" - "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/runtime" + runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" + "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/server/api" "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" @@ -80,35 +91,21 @@ import ( upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/cosmos/ibc-go/v7/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v7/modules/core" - ibcclient "github.com/cosmos/ibc-go/v7/modules/core/02-client" - ibcclientclient "github.com/cosmos/ibc-go/v7/modules/core/02-client/client" - ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - ibcconnectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - ibchost "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" - tendermint "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - - ibctestingcore "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/core" - ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing" dbm "github.com/cometbft/cometbft-db" abci "github.com/cometbft/cometbft/abci/types" tmjson "github.com/cometbft/cometbft/libs/json" "github.com/cometbft/cometbft/libs/log" tmos "github.com/cometbft/cometbft/libs/os" - "github.com/spf13/cast" + appparams "github.com/cosmos/interchain-security/v3/app/params" + ibctestingcore "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/core" + ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing" + testutil "github.com/cosmos/interchain-security/v3/testutil/integration" ibcprovider "github.com/cosmos/interchain-security/v3/x/ccv/provider" ibcproviderclient "github.com/cosmos/interchain-security/v3/x/ccv/provider/client" ibcproviderkeeper "github.com/cosmos/interchain-security/v3/x/ccv/provider/keeper" providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" - - testutil "github.com/cosmos/interchain-security/v3/testutil/integration" ) const ( diff --git a/app/provider/export.go b/app/provider/export.go index 3865026b01..74faed0657 100644 --- a/app/provider/export.go +++ b/app/provider/export.go @@ -4,13 +4,13 @@ import ( "encoding/json" "log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" "github.com/cosmos/cosmos-sdk/x/staking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" ) // ExportAppStateAndValidators exports the state of the application for a genesis diff --git a/app/sovereign/ante_handler.go b/app/sovereign/ante_handler.go index 0a71573b07..9ba33d3264 100644 --- a/app/sovereign/ante_handler.go +++ b/app/sovereign/ante_handler.go @@ -1,12 +1,14 @@ package app import ( + ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" + ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/auth/ante" - ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" ) // HandlerOptions extend the SDK's AnteHandler options by requiring the IBC diff --git a/app/sovereign/app.go b/app/sovereign/app.go index b1049255f9..1693cb1b60 100644 --- a/app/sovereign/app.go +++ b/app/sovereign/app.go @@ -7,10 +7,19 @@ import ( "os" "path/filepath" + "github.com/cosmos/ibc-go/v7/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v7/modules/core" + ibcconnectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" + porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" + ibchost "github.com/cosmos/ibc-go/v7/modules/core/exported" + ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + tendermint "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + "github.com/spf13/cast" + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" - runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" - appparams "github.com/cosmos/interchain-security/v3/app/params" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" @@ -20,8 +29,8 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/runtime" + runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" "github.com/cosmos/cosmos-sdk/server" - "github.com/cosmos/cosmos-sdk/server/api" "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" @@ -30,11 +39,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/version" - - "github.com/cosmos/cosmos-sdk/x/consensus" - consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" - consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" - "github.com/cosmos/cosmos-sdk/x/auth" "github.com/cosmos/cosmos-sdk/x/auth/ante" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" @@ -51,70 +55,58 @@ import ( "github.com/cosmos/cosmos-sdk/x/capability" capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + "github.com/cosmos/cosmos-sdk/x/consensus" + consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" + consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" "github.com/cosmos/cosmos-sdk/x/crisis" crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" + sdkdistr "github.com/cosmos/cosmos-sdk/x/distribution" + distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" "github.com/cosmos/cosmos-sdk/x/evidence" evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper" evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" "github.com/cosmos/cosmos-sdk/x/feegrant" feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module" + "github.com/cosmos/cosmos-sdk/x/genutil" + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" + sdkgov "github.com/cosmos/cosmos-sdk/x/gov" govclient "github.com/cosmos/cosmos-sdk/x/gov/client" + govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - + // add mint + mint "github.com/cosmos/cosmos-sdk/x/mint" + mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/cosmos/cosmos-sdk/x/params" paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" + "github.com/cosmos/cosmos-sdk/x/slashing" + slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/cosmos/cosmos-sdk/x/upgrade" upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" + upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" dbm "github.com/cometbft/cometbft-db" abci "github.com/cometbft/cometbft/abci/types" tmjson "github.com/cometbft/cometbft/libs/json" "github.com/cometbft/cometbft/libs/log" tmos "github.com/cometbft/cometbft/libs/os" - "github.com/cosmos/cosmos-sdk/x/slashing" - slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" - slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - "github.com/cosmos/cosmos-sdk/x/upgrade" - upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/cosmos/ibc-go/v7/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v7/modules/core" - ibcconnectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - ibchost "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + + appparams "github.com/cosmos/interchain-security/v3/app/params" ibctestingcore "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/core" ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing" - "github.com/spf13/cast" - - sdkdistr "github.com/cosmos/cosmos-sdk/x/distribution" - distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" - distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" testutil "github.com/cosmos/interchain-security/v3/testutil/integration" - - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking" - stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - - "github.com/cosmos/cosmos-sdk/x/genutil" - genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - - sdkgov "github.com/cosmos/cosmos-sdk/x/gov" - govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - - // add mint - mint "github.com/cosmos/cosmos-sdk/x/mint" - mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - - paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" - tendermint "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" ) const ( diff --git a/app/sovereign/export.go b/app/sovereign/export.go index 770d9b540f..93d46bf973 100644 --- a/app/sovereign/export.go +++ b/app/sovereign/export.go @@ -4,13 +4,13 @@ import ( "encoding/json" "log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" "github.com/cosmos/cosmos-sdk/x/staking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" ) // ExportAppStateAndValidators exports the state of the application for a genesis diff --git a/cmd/interchain-security-cd/cmd/root.go b/cmd/interchain-security-cd/cmd/root.go index 5fac172a96..30c032bbea 100644 --- a/cmd/interchain-security-cd/cmd/root.go +++ b/cmd/interchain-security-cd/cmd/root.go @@ -5,15 +5,11 @@ import ( "io" "os" - dbm "github.com/cometbft/cometbft-db" - tmcfg "github.com/cometbft/cometbft/config" - "github.com/cometbft/cometbft/libs/log" - serverconfig "github.com/cosmos/cosmos-sdk/server/config" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" "github.com/spf13/cobra" "github.com/spf13/viper" rosettaCmd "cosmossdk.io/tools/rosetta/cmd" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/config" "github.com/cosmos/cosmos-sdk/client/debug" @@ -22,12 +18,19 @@ import ( "github.com/cosmos/cosmos-sdk/client/pruning" "github.com/cosmos/cosmos-sdk/client/rpc" "github.com/cosmos/cosmos-sdk/server" + serverconfig "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/crisis" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" + + dbm "github.com/cometbft/cometbft-db" + tmcfg "github.com/cometbft/cometbft/config" + "github.com/cometbft/cometbft/libs/log" + consumer "github.com/cosmos/interchain-security/v3/app/consumer" "github.com/cosmos/interchain-security/v3/app/params" ) diff --git a/cmd/interchain-security-cd/main.go b/cmd/interchain-security-cd/main.go index 012e5c6d44..12afc46e65 100644 --- a/cmd/interchain-security-cd/main.go +++ b/cmd/interchain-security-cd/main.go @@ -5,6 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" + app "github.com/cosmos/interchain-security/v3/app/consumer" "github.com/cosmos/interchain-security/v3/cmd/interchain-security-cd/cmd" ) diff --git a/cmd/interchain-security-cdd/cmd/root.go b/cmd/interchain-security-cdd/cmd/root.go index 1e3f038717..989bb5a462 100644 --- a/cmd/interchain-security-cdd/cmd/root.go +++ b/cmd/interchain-security-cdd/cmd/root.go @@ -5,14 +5,11 @@ import ( "io" "os" - dbm "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" - serverconfig "github.com/cosmos/cosmos-sdk/server/config" "github.com/spf13/cobra" "github.com/spf13/viper" rosettaCmd "cosmossdk.io/tools/rosetta/cmd" - tmcfg "github.com/cometbft/cometbft/config" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/config" "github.com/cosmos/cosmos-sdk/client/debug" @@ -21,6 +18,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/pruning" "github.com/cosmos/cosmos-sdk/client/rpc" "github.com/cosmos/cosmos-sdk/server" + serverconfig "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" @@ -29,6 +27,10 @@ import ( "github.com/cosmos/cosmos-sdk/x/crisis" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" + dbm "github.com/cometbft/cometbft-db" + tmcfg "github.com/cometbft/cometbft/config" + "github.com/cometbft/cometbft/libs/log" + cdd "github.com/cosmos/interchain-security/v3/app/consumer-democracy" "github.com/cosmos/interchain-security/v3/app/params" ) diff --git a/cmd/interchain-security-cdd/main.go b/cmd/interchain-security-cdd/main.go index 5d04ea379b..085903425e 100644 --- a/cmd/interchain-security-cdd/main.go +++ b/cmd/interchain-security-cdd/main.go @@ -5,6 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" + app "github.com/cosmos/interchain-security/v3/app/consumer-democracy" "github.com/cosmos/interchain-security/v3/cmd/interchain-security-cdd/cmd" ) diff --git a/cmd/interchain-security-pd/cmd/root.go b/cmd/interchain-security-pd/cmd/root.go index 246e1c182b..745d81127c 100644 --- a/cmd/interchain-security-pd/cmd/root.go +++ b/cmd/interchain-security-pd/cmd/root.go @@ -5,14 +5,11 @@ import ( "io" "os" - dbm "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" - serverconfig "github.com/cosmos/cosmos-sdk/server/config" "github.com/spf13/cobra" "github.com/spf13/viper" rosettaCmd "cosmossdk.io/tools/rosetta/cmd" - tmcfg "github.com/cometbft/cometbft/config" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/config" "github.com/cosmos/cosmos-sdk/client/debug" @@ -21,6 +18,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/pruning" "github.com/cosmos/cosmos-sdk/client/rpc" "github.com/cosmos/cosmos-sdk/server" + serverconfig "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" @@ -28,6 +26,11 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/crisis" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" + + dbm "github.com/cometbft/cometbft-db" + tmcfg "github.com/cometbft/cometbft/config" + "github.com/cometbft/cometbft/libs/log" + "github.com/cosmos/interchain-security/v3/app/params" providerApp "github.com/cosmos/interchain-security/v3/app/provider" ) diff --git a/cmd/interchain-security-pd/main.go b/cmd/interchain-security-pd/main.go index 9ad1cd67cc..361c0fb8e1 100644 --- a/cmd/interchain-security-pd/main.go +++ b/cmd/interchain-security-pd/main.go @@ -5,6 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" + app "github.com/cosmos/interchain-security/v3/app/provider" "github.com/cosmos/interchain-security/v3/cmd/interchain-security-pd/cmd" ) diff --git a/cmd/interchain-security-sd/cmd/root.go b/cmd/interchain-security-sd/cmd/root.go index a93c841474..e5264b8735 100644 --- a/cmd/interchain-security-sd/cmd/root.go +++ b/cmd/interchain-security-sd/cmd/root.go @@ -5,14 +5,11 @@ import ( "io" "os" - dbm "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" - serverconfig "github.com/cosmos/cosmos-sdk/server/config" "github.com/spf13/cobra" "github.com/spf13/viper" rosettaCmd "cosmossdk.io/tools/rosetta/cmd" - tmcfg "github.com/cometbft/cometbft/config" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/config" "github.com/cosmos/cosmos-sdk/client/debug" @@ -21,6 +18,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/pruning" "github.com/cosmos/cosmos-sdk/client/rpc" "github.com/cosmos/cosmos-sdk/server" + serverconfig "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" @@ -28,6 +26,11 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/crisis" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" + + dbm "github.com/cometbft/cometbft-db" + tmcfg "github.com/cometbft/cometbft/config" + "github.com/cometbft/cometbft/libs/log" + "github.com/cosmos/interchain-security/v3/app/params" sovereignApp "github.com/cosmos/interchain-security/v3/app/sovereign" ) diff --git a/cmd/interchain-security-sd/main.go b/cmd/interchain-security-sd/main.go index 7c4dc35493..9b59188ea5 100644 --- a/cmd/interchain-security-sd/main.go +++ b/cmd/interchain-security-sd/main.go @@ -5,6 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" + app "github.com/cosmos/interchain-security/v3/app/sovereign" "github.com/cosmos/interchain-security/v3/cmd/interchain-security-sd/cmd" ) diff --git a/tests/difference/core/driver/common.go b/tests/difference/core/driver/common.go index bff271e235..8ea1a4cc36 100644 --- a/tests/difference/core/driver/common.go +++ b/tests/difference/core/driver/common.go @@ -3,10 +3,11 @@ package core import ( "time" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtypes "github.com/cometbft/cometbft/types" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtypes "github.com/cometbft/cometbft/types" ) const ( diff --git a/tests/difference/core/driver/core_test.go b/tests/difference/core/driver/core_test.go index 648955f66d..12192eb8e4 100644 --- a/tests/difference/core/driver/core_test.go +++ b/tests/difference/core/driver/core_test.go @@ -5,21 +5,19 @@ import ( "testing" "time" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/suite" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - ibctestingcore "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/core" - ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing" + "github.com/stretchr/testify/suite" + sdk "github.com/cosmos/cosmos-sdk/types" + slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + appConsumer "github.com/cosmos/interchain-security/v3/app/consumer" appProvider "github.com/cosmos/interchain-security/v3/app/provider" - + ibctestingcore "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/core" + ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing" simibc "github.com/cosmos/interchain-security/v3/testutil/simibc" - - slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" consumerkeeper "github.com/cosmos/interchain-security/v3/x/ccv/consumer/keeper" ) diff --git a/tests/difference/core/driver/seed_gen_fuzzy_test.go b/tests/difference/core/driver/seed_gen_fuzzy_test.go index 0ea051c63b..610d31e40e 100644 --- a/tests/difference/core/driver/seed_gen_fuzzy_test.go +++ b/tests/difference/core/driver/seed_gen_fuzzy_test.go @@ -2,15 +2,16 @@ package core_test import ( "bytes" + cryptoEd25519 "crypto/ed25519" "testing" - cryptoEd25519 "crypto/ed25519" + mock "github.com/cosmos/ibc-go/v7/testing/mock" - tmtypes "github.com/cometbft/cometbft/types" cosmosEd25519 "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - mock "github.com/cosmos/ibc-go/v7/testing/mock" + + tmtypes "github.com/cometbft/cometbft/types" ) func GetPV(seed []byte) mock.PV { diff --git a/tests/difference/core/driver/setup.go b/tests/difference/core/driver/setup.go index ff42784bc5..fb5bf6a611 100644 --- a/tests/difference/core/driver/setup.go +++ b/tests/difference/core/driver/setup.go @@ -6,41 +6,39 @@ import ( "encoding/json" "time" - abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtypes "github.com/cometbft/cometbft/types" + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" + ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + "github.com/cosmos/ibc-go/v7/testing/mock" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + "github.com/cosmos/cosmos-sdk/baseapp" codectypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" cosmosEd25519 "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" - - ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing" - - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" - ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - "github.com/cosmos/ibc-go/v7/testing/mock" - slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + abci "github.com/cometbft/cometbft/abci/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtypes "github.com/cometbft/cometbft/types" + appConsumer "github.com/cosmos/interchain-security/v3/app/consumer" appProvider "github.com/cosmos/interchain-security/v3/app/provider" + ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing" icstestingutils "github.com/cosmos/interchain-security/v3/testutil/ibc_testing" simibc "github.com/cosmos/interchain-security/v3/testutil/simibc" consumerkeeper "github.com/cosmos/interchain-security/v3/x/ccv/consumer/keeper" consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" providerkeeper "github.com/cosmos/interchain-security/v3/x/ccv/provider/keeper" - ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" ) diff --git a/tests/e2e/actions.go b/tests/e2e/actions.go index 719e5d7517..3dd8fb704e 100644 --- a/tests/e2e/actions.go +++ b/tests/e2e/actions.go @@ -12,13 +12,14 @@ import ( "sync" "time" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + "github.com/tidwall/gjson" + + evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" "github.com/cosmos/interchain-security/v3/x/ccv/provider/client" "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" - "github.com/tidwall/gjson" ) type SendTokensAction struct { diff --git a/tests/integration/common.go b/tests/integration/common.go index d387760724..7d5175d5d7 100644 --- a/tests/integration/common.go +++ b/tests/integration/common.go @@ -4,24 +4,28 @@ import ( "fmt" "time" - "cosmossdk.io/math" - abci "github.com/cometbft/cometbft/abci/types" - tmtypes "github.com/cometbft/cometbft/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" "github.com/cosmos/ibc-go/v7/modules/core/exported" ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + "github.com/stretchr/testify/require" + + "cosmossdk.io/math" + + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + abci "github.com/cometbft/cometbft/abci/types" + tmtypes "github.com/cometbft/cometbft/types" + ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing" icstestingutils "github.com/cosmos/interchain-security/v3/testutil/ibc_testing" testutil "github.com/cosmos/interchain-security/v3/testutil/integration" providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" - "github.com/stretchr/testify/require" ) // ChainType defines the type of chain (either provider or consumer) diff --git a/tests/integration/democracy.go b/tests/integration/democracy.go index f914d581d7..461cfec3b3 100644 --- a/tests/integration/democracy.go +++ b/tests/integration/democracy.go @@ -4,18 +4,20 @@ import ( "testing" "time" + "github.com/stretchr/testify/suite" + "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" - ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing" - icstestingutils "github.com/cosmos/interchain-security/v3/testutil/ibc_testing" + sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + + ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing" + icstestingutils "github.com/cosmos/interchain-security/v3/testutil/ibc_testing" testutil "github.com/cosmos/interchain-security/v3/testutil/integration" consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" - "github.com/stretchr/testify/suite" ) type ConsumerDemocracyTestSuite struct { diff --git a/tests/integration/distribution.go b/tests/integration/distribution.go index 8ba2a8756b..a896a6f22b 100644 --- a/tests/integration/distribution.go +++ b/tests/integration/distribution.go @@ -3,10 +3,11 @@ package integration import ( "strings" + transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" diff --git a/tests/integration/expired_client.go b/tests/integration/expired_client.go index 89c8280b33..38d2a3ab5e 100644 --- a/tests/integration/expired_client.go +++ b/tests/integration/expired_client.go @@ -3,14 +3,16 @@ package integration import ( "time" - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" - sdk "github.com/cosmos/cosmos-sdk/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + abci "github.com/cometbft/cometbft/abci/types" + ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing" ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" ) diff --git a/tests/integration/instance_test.go b/tests/integration/instance_test.go index 7602f02c5e..3c2f018807 100644 --- a/tests/integration/instance_test.go +++ b/tests/integration/instance_test.go @@ -3,12 +3,13 @@ package integration_test import ( "testing" + "github.com/stretchr/testify/suite" + appConsumer "github.com/cosmos/interchain-security/v3/app/consumer" appConsumerDemocracy "github.com/cosmos/interchain-security/v3/app/consumer-democracy" appProvider "github.com/cosmos/interchain-security/v3/app/provider" intg "github.com/cosmos/interchain-security/v3/tests/integration" icstestingutils "github.com/cosmos/interchain-security/v3/testutil/ibc_testing" - "github.com/stretchr/testify/suite" ) // This file can be used as an example integration testing instance for any provider/consumer applications. diff --git a/tests/integration/key_assignment.go b/tests/integration/key_assignment.go index 5ffabbeab4..fbe6430c67 100644 --- a/tests/integration/key_assignment.go +++ b/tests/integration/key_assignment.go @@ -1,11 +1,13 @@ package integration import ( - tmencoding "github.com/cometbft/cometbft/crypto/encoding" - tmprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + "github.com/cosmos/ibc-go/v7/testing/mock" + sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/ibc-go/v7/testing/mock" + + tmencoding "github.com/cometbft/cometbft/crypto/encoding" + tmprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" providerkeeper "github.com/cosmos/interchain-security/v3/x/ccv/provider/keeper" ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" diff --git a/tests/integration/normal_operations.go b/tests/integration/normal_operations.go index af2137e5dc..b676689e89 100644 --- a/tests/integration/normal_operations.go +++ b/tests/integration/normal_operations.go @@ -1,8 +1,10 @@ package integration import ( - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" ) diff --git a/tests/integration/setup.go b/tests/integration/setup.go index 07987ce0d7..a18ff551e4 100644 --- a/tests/integration/setup.go +++ b/tests/integration/setup.go @@ -3,21 +3,21 @@ package integration import ( "testing" - tmencoding "github.com/cometbft/cometbft/crypto/encoding" - sdk "github.com/cosmos/cosmos-sdk/types" + transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" "github.com/cosmos/ibc-go/v7/testing/mock" - testutil "github.com/cosmos/interchain-security/v3/testutil/integration" + "github.com/stretchr/testify/suite" + + sdk "github.com/cosmos/cosmos-sdk/types" + + tmencoding "github.com/cometbft/cometbft/crypto/encoding" + ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing" icstestingutils "github.com/cosmos/interchain-security/v3/testutil/ibc_testing" + testutil "github.com/cosmos/interchain-security/v3/testutil/integration" consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" - - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing" - - "github.com/stretchr/testify/suite" ) // Callback for instantiating a new coordinator with a provider test chains diff --git a/tests/integration/slashing.go b/tests/integration/slashing.go index 68b632efe1..28ae9da958 100644 --- a/tests/integration/slashing.go +++ b/tests/integration/slashing.go @@ -4,20 +4,22 @@ import ( "fmt" "time" - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/crypto/ed25519" + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cometbft/cometbft/crypto/ed25519" tmtypes "github.com/cometbft/cometbft/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + keepertestutil "github.com/cosmos/interchain-security/v3/testutil/keeper" providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" + ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" ) // TestRelayAndApplyDowntimePacket tests that downtime slash packets can be properly relayed diff --git a/tests/integration/stop_consumer.go b/tests/integration/stop_consumer.go index f6e0d77d59..43ecaf9e33 100644 --- a/tests/integration/stop_consumer.go +++ b/tests/integration/stop_consumer.go @@ -1,10 +1,12 @@ package integration import ( - abci "github.com/cometbft/cometbft/abci/types" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" diff --git a/tests/integration/throttle.go b/tests/integration/throttle.go index 0620bdd6b6..0505d6257a 100644 --- a/tests/integration/throttle.go +++ b/tests/integration/throttle.go @@ -3,10 +3,12 @@ package integration import ( "time" - tmtypes "github.com/cometbft/cometbft/types" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + + tmtypes "github.com/cometbft/cometbft/types" icstestingutils "github.com/cosmos/interchain-security/v3/testutil/ibc_testing" "github.com/cosmos/interchain-security/v3/x/ccv/provider" diff --git a/tests/integration/unbonding.go b/tests/integration/unbonding.go index 87454be324..7693c782e5 100644 --- a/tests/integration/unbonding.go +++ b/tests/integration/unbonding.go @@ -4,6 +4,7 @@ import ( "time" "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" providerkeeper "github.com/cosmos/interchain-security/v3/x/ccv/provider/keeper" diff --git a/tests/integration/valset_update.go b/tests/integration/valset_update.go index e1c0d920ea..955261aa79 100644 --- a/tests/integration/valset_update.go +++ b/tests/integration/valset_update.go @@ -3,11 +3,14 @@ package integration import ( "time" - abci "github.com/cometbft/cometbft/abci/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - sdk "github.com/cosmos/cosmos-sdk/types" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + + abci "github.com/cometbft/cometbft/abci/types" + ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" ) diff --git a/x/ccv/consumer/client/cli/query.go b/x/ccv/consumer/client/cli/query.go index dc88aaf9d9..a961b9642c 100644 --- a/x/ccv/consumer/client/cli/query.go +++ b/x/ccv/consumer/client/cli/query.go @@ -5,6 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" ) diff --git a/x/ccv/consumer/ibc_module.go b/x/ccv/consumer/ibc_module.go index 0ca0b29370..74c4cff27c 100644 --- a/x/ccv/consumer/ibc_module.go +++ b/x/ccv/consumer/ibc_module.go @@ -4,18 +4,18 @@ import ( "fmt" "strings" - errorsmod "cosmossdk.io/errors" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - sdk "github.com/cosmos/cosmos-sdk/types" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" host "github.com/cosmos/ibc-go/v7/modules/core/24-host" ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" + errorsmod "cosmossdk.io/errors" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + "github.com/cosmos/interchain-security/v3/x/ccv/consumer/keeper" consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" diff --git a/x/ccv/consumer/ibc_module_test.go b/x/ccv/consumer/ibc_module_test.go index 9e326bcbe6..a451625230 100644 --- a/x/ccv/consumer/ibc_module_test.go +++ b/x/ccv/consumer/ibc_module_test.go @@ -3,20 +3,21 @@ package consumer_test import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" host "github.com/cosmos/ibc-go/v7/modules/core/24-host" + "github.com/golang/mock/gomock" + "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + testkeeper "github.com/cosmos/interchain-security/v3/testutil/keeper" "github.com/cosmos/interchain-security/v3/x/ccv/consumer" consumerkeeper "github.com/cosmos/interchain-security/v3/x/ccv/consumer/keeper" providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" - - "github.com/golang/mock/gomock" - "github.com/stretchr/testify/require" ) // TestOnChanOpenInit validates the consumer's OnChanOpenInit implementation against the spec. diff --git a/x/ccv/consumer/keeper/changeover.go b/x/ccv/consumer/keeper/changeover.go index 1221792d3c..74276d1253 100644 --- a/x/ccv/consumer/keeper/changeover.go +++ b/x/ccv/consumer/keeper/changeover.go @@ -1,8 +1,9 @@ package keeper import ( - abci "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" + + abci "github.com/cometbft/cometbft/abci/types" ) // ChangeoverIsComplete returns whether the standalone to consumer changeover process is complete. diff --git a/x/ccv/consumer/keeper/changeover_test.go b/x/ccv/consumer/keeper/changeover_test.go index 4009890b52..fcd9a70459 100644 --- a/x/ccv/consumer/keeper/changeover_test.go +++ b/x/ccv/consumer/keeper/changeover_test.go @@ -3,13 +3,16 @@ package keeper_test import ( "testing" - abci "github.com/cometbft/cometbft/abci/types" + "github.com/golang/mock/gomock" + "github.com/stretchr/testify/require" + sdkcryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cosmos/interchain-security/v3/testutil/crypto" uthelpers "github.com/cosmos/interchain-security/v3/testutil/keeper" - "github.com/golang/mock/gomock" - "github.com/stretchr/testify/require" ) func TestChangeoverToConsumer(t *testing.T) { diff --git a/x/ccv/consumer/keeper/distribution.go b/x/ccv/consumer/keeper/distribution.go index 9d59be2f89..48f1c5a1eb 100644 --- a/x/ccv/consumer/keeper/distribution.go +++ b/x/ccv/consumer/keeper/distribution.go @@ -4,13 +4,14 @@ import ( "fmt" "strconv" - errorsmod "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + errorsmod "cosmossdk.io/errors" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" ) diff --git a/x/ccv/consumer/keeper/distribution_test.go b/x/ccv/consumer/keeper/distribution_test.go index 07f49b5b8c..71df5fd93d 100644 --- a/x/ccv/consumer/keeper/distribution_test.go +++ b/x/ccv/consumer/keeper/distribution_test.go @@ -4,13 +4,14 @@ import ( "strings" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" authTypes "github.com/cosmos/cosmos-sdk/x/auth/types" + testkeeper "github.com/cosmos/interchain-security/v3/testutil/keeper" "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" - "github.com/golang/mock/gomock" ) // TestGetEstimatedNextFeeDistribution tests next fee distribution parameters. diff --git a/x/ccv/consumer/keeper/genesis.go b/x/ccv/consumer/keeper/genesis.go index d9e905bbd8..45ea54f49c 100644 --- a/x/ccv/consumer/keeper/genesis.go +++ b/x/ccv/consumer/keeper/genesis.go @@ -4,10 +4,11 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" - ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" abci "github.com/cometbft/cometbft/abci/types" + + consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" + ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" ) // InitGenesis initializes the CCV consumer state and binds to PortID. diff --git a/x/ccv/consumer/keeper/genesis_test.go b/x/ccv/consumer/keeper/genesis_test.go index a2c0f6a88b..47d834f8a8 100644 --- a/x/ccv/consumer/keeper/genesis_test.go +++ b/x/ccv/consumer/keeper/genesis_test.go @@ -4,25 +4,25 @@ import ( "testing" "time" - abci "github.com/cometbft/cometbft/abci/types" - tmtypes "github.com/cometbft/cometbft/types" - sdk "github.com/cosmos/cosmos-sdk/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - "github.com/cosmos/interchain-security/v3/testutil/crypto" - testkeeper "github.com/cosmos/interchain-security/v3/testutil/keeper" - consumerkeeper "github.com/cosmos/interchain-security/v3/x/ccv/consumer/keeper" - ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + abci "github.com/cometbft/cometbft/abci/types" + tmtypes "github.com/cometbft/cometbft/types" + + "github.com/cosmos/interchain-security/v3/testutil/crypto" + testkeeper "github.com/cosmos/interchain-security/v3/testutil/keeper" + consumerkeeper "github.com/cosmos/interchain-security/v3/x/ccv/consumer/keeper" consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" + ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" ) // TestInitGenesis tests that a consumer chain is correctly initialised from genesis. diff --git a/x/ccv/consumer/keeper/grpc_query.go b/x/ccv/consumer/keeper/grpc_query.go index 299e485faf..174f591497 100644 --- a/x/ccv/consumer/keeper/grpc_query.go +++ b/x/ccv/consumer/keeper/grpc_query.go @@ -3,10 +3,12 @@ package keeper import ( "context" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/ccv/consumer/keeper/hooks.go b/x/ccv/consumer/keeper/hooks.go index da3058555b..7f03896e55 100644 --- a/x/ccv/consumer/keeper/hooks.go +++ b/x/ccv/consumer/keeper/hooks.go @@ -2,6 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" + ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" ) diff --git a/x/ccv/consumer/keeper/keeper.go b/x/ccv/consumer/keeper/keeper.go index 24a1234065..7da13ab433 100644 --- a/x/ccv/consumer/keeper/keeper.go +++ b/x/ccv/consumer/keeper/keeper.go @@ -6,21 +6,22 @@ import ( "reflect" "time" + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + host "github.com/cosmos/ibc-go/v7/modules/core/24-host" + errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/codec" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - host "github.com/cosmos/ibc-go/v7/modules/core/24-host" - tmtypes "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/libs/log" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" diff --git a/x/ccv/consumer/keeper/keeper_test.go b/x/ccv/consumer/keeper/keeper_test.go index 7b23c777c5..662a776cef 100644 --- a/x/ccv/consumer/keeper/keeper_test.go +++ b/x/ccv/consumer/keeper/keeper_test.go @@ -6,21 +6,21 @@ import ( "testing" "time" - abci "github.com/cometbft/cometbft/abci/types" + conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" + "github.com/golang/mock/gomock" + "github.com/stretchr/testify/require" + + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cosmos/interchain-security/v3/testutil/crypto" testkeeper "github.com/cosmos/interchain-security/v3/testutil/keeper" "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" - - "github.com/golang/mock/gomock" - "github.com/stretchr/testify/require" - - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" ) // TestProviderClientID tests getter and setter functionality for the client ID stored on consumer keeper diff --git a/x/ccv/consumer/keeper/params_test.go b/x/ccv/consumer/keeper/params_test.go index 7573613199..ac6b112aa8 100644 --- a/x/ccv/consumer/keeper/params_test.go +++ b/x/ccv/consumer/keeper/params_test.go @@ -4,10 +4,11 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + testkeeper "github.com/cosmos/interchain-security/v3/testutil/keeper" "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" - "github.com/stretchr/testify/require" ) // TestParams tests getters/setters for consumer params diff --git a/x/ccv/consumer/keeper/relay.go b/x/ccv/consumer/keeper/relay.go index d9e922ed3d..cd5105421e 100644 --- a/x/ccv/consumer/keeper/relay.go +++ b/x/ccv/consumer/keeper/relay.go @@ -4,14 +4,17 @@ import ( "fmt" "strconv" - errorsmod "cosmossdk.io/errors" - abci "github.com/cometbft/cometbft/abci/types" - sdk "github.com/cosmos/cosmos-sdk/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" "github.com/cosmos/ibc-go/v7/modules/core/exported" + errorsmod "cosmossdk.io/errors" + + sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" ) diff --git a/x/ccv/consumer/keeper/relay_test.go b/x/ccv/consumer/keeper/relay_test.go index 1c2ba5152f..962fc943bd 100644 --- a/x/ccv/consumer/keeper/relay_test.go +++ b/x/ccv/consumer/keeper/relay_test.go @@ -6,24 +6,24 @@ import ( "testing" "time" - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/bytes" + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + host "github.com/cosmos/ibc-go/v7/modules/core/24-host" + "github.com/golang/mock/gomock" + "github.com/stretchr/testify/require" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - host "github.com/cosmos/ibc-go/v7/modules/core/24-host" + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cometbft/cometbft/libs/bytes" "github.com/cosmos/interchain-security/v3/testutil/crypto" testkeeper "github.com/cosmos/interchain-security/v3/testutil/keeper" consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" "github.com/cosmos/interchain-security/v3/x/ccv/types" - - "github.com/golang/mock/gomock" - "github.com/stretchr/testify/require" ) // TestOnRecvVSCPacket tests the behavior of OnRecvVSCPacket over various packet scenarios diff --git a/x/ccv/consumer/keeper/soft_opt_out.go b/x/ccv/consumer/keeper/soft_opt_out.go index 23a27d4b96..09b8a9be79 100644 --- a/x/ccv/consumer/keeper/soft_opt_out.go +++ b/x/ccv/consumer/keeper/soft_opt_out.go @@ -5,6 +5,7 @@ import ( "sort" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" ) diff --git a/x/ccv/consumer/keeper/soft_opt_out_test.go b/x/ccv/consumer/keeper/soft_opt_out_test.go index 34e5570674..c99d418ca6 100644 --- a/x/ccv/consumer/keeper/soft_opt_out_test.go +++ b/x/ccv/consumer/keeper/soft_opt_out_test.go @@ -3,13 +3,13 @@ package keeper_test import ( "testing" + "github.com/stretchr/testify/require" + tmtypes "github.com/cometbft/cometbft/types" "github.com/cosmos/interchain-security/v3/testutil/crypto" testkeeper "github.com/cosmos/interchain-security/v3/testutil/keeper" "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" - - "github.com/stretchr/testify/require" ) // Tests that UpdateSmallestNonOptOutPower updates the smallest validator power that cannot soft opt out. diff --git a/x/ccv/consumer/keeper/validators.go b/x/ccv/consumer/keeper/validators.go index 068767546b..2233b22d28 100644 --- a/x/ccv/consumer/keeper/validators.go +++ b/x/ccv/consumer/keeper/validators.go @@ -4,11 +4,13 @@ import ( "time" "cosmossdk.io/math" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - abci "github.com/cometbft/cometbft/abci/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" ) diff --git a/x/ccv/consumer/keeper/validators_test.go b/x/ccv/consumer/keeper/validators_test.go index 724ce787d0..67ab91f531 100644 --- a/x/ccv/consumer/keeper/validators_test.go +++ b/x/ccv/consumer/keeper/validators_test.go @@ -3,18 +3,22 @@ package keeper_test import ( "testing" + "github.com/stretchr/testify/require" + "cosmossdk.io/math" - abci "github.com/cometbft/cometbft/abci/types" - tmrand "github.com/cometbft/cometbft/libs/rand" - tmtypes "github.com/cometbft/cometbft/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + abci "github.com/cometbft/cometbft/abci/types" + tmrand "github.com/cometbft/cometbft/libs/rand" + tmtypes "github.com/cometbft/cometbft/types" + "github.com/cosmos/interchain-security/v3/testutil/crypto" testkeeper "github.com/cosmos/interchain-security/v3/testutil/keeper" "github.com/cosmos/interchain-security/v3/x/ccv/consumer/keeper" "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" - "github.com/stretchr/testify/require" ) // TestApplyCCValidatorChanges tests the ApplyCCValidatorChanges method for a consumer keeper diff --git a/x/ccv/consumer/module.go b/x/ccv/consumer/module.go index 3d80fb1df1..6c05273451 100644 --- a/x/ccv/consumer/module.go +++ b/x/ccv/consumer/module.go @@ -5,9 +5,7 @@ import ( "encoding/json" "fmt" - abci "github.com/cometbft/cometbft/abci/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - + porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" @@ -17,11 +15,12 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/interchain-security/v3/x/ccv/consumer/client/cli" "github.com/cosmos/interchain-security/v3/x/ccv/consumer/keeper" - consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" ) diff --git a/x/ccv/consumer/types/genesis.go b/x/ccv/consumer/types/genesis.go index 82b6e2c1fa..3a8769939b 100644 --- a/x/ccv/consumer/types/genesis.go +++ b/x/ccv/consumer/types/genesis.go @@ -1,9 +1,11 @@ package types import ( + ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + errorsmod "cosmossdk.io/errors" + abci "github.com/cometbft/cometbft/abci/types" - ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" ) diff --git a/x/ccv/consumer/types/genesis_test.go b/x/ccv/consumer/types/genesis_test.go index 9ce1c4927a..2f4b2fa504 100644 --- a/x/ccv/consumer/types/genesis_test.go +++ b/x/ccv/consumer/types/genesis_test.go @@ -4,22 +4,20 @@ import ( "testing" "time" - sdk "github.com/cosmos/cosmos-sdk/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - - abci "github.com/cometbft/cometbft/abci/types" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + "github.com/stretchr/testify/require" - "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" + sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + abci "github.com/cometbft/cometbft/abci/types" tmtypes "github.com/cometbft/cometbft/types" "github.com/cosmos/interchain-security/v3/testutil/crypto" - + "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" - "github.com/stretchr/testify/require" ) const ( diff --git a/x/ccv/consumer/types/keys.go b/x/ccv/consumer/types/keys.go index 24be1819c6..0ceed2814e 100644 --- a/x/ccv/consumer/types/keys.go +++ b/x/ccv/consumer/types/keys.go @@ -5,6 +5,7 @@ import ( time "time" sdk "github.com/cosmos/cosmos-sdk/types" + ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/types" ) diff --git a/x/ccv/consumer/types/params.go b/x/ccv/consumer/types/params.go index 485bb8fda5..a9b4e61285 100644 --- a/x/ccv/consumer/types/params.go +++ b/x/ccv/consumer/types/params.go @@ -7,6 +7,7 @@ import ( sdktypes "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/types" ) diff --git a/x/ccv/consumer/types/validator.go b/x/ccv/consumer/types/validator.go index c546a68440..b134dde078 100644 --- a/x/ccv/consumer/types/validator.go +++ b/x/ccv/consumer/types/validator.go @@ -2,6 +2,7 @@ package types import ( errorsmod "cosmossdk.io/errors" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" diff --git a/x/ccv/democracy/distribution/module.go b/x/ccv/democracy/distribution/module.go index 7f4842314e..60532dde48 100644 --- a/x/ccv/democracy/distribution/module.go +++ b/x/ccv/democracy/distribution/module.go @@ -4,19 +4,19 @@ import ( "time" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" distr "github.com/cosmos/cosmos-sdk/x/distribution" "github.com/cosmos/cosmos-sdk/x/distribution/exported" "github.com/cosmos/cosmos-sdk/x/distribution/keeper" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" abci "github.com/cometbft/cometbft/abci/types" - distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + + consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" ) var ( diff --git a/x/ccv/democracy/governance/module.go b/x/ccv/democracy/governance/module.go index c293a9e3e3..3922607766 100644 --- a/x/ccv/democracy/governance/module.go +++ b/x/ccv/democracy/governance/module.go @@ -6,13 +6,13 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - - abci "github.com/cometbft/cometbft/abci/types" gov "github.com/cosmos/cosmos-sdk/x/gov" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + + abci "github.com/cometbft/cometbft/abci/types" ) const ( diff --git a/x/ccv/democracy/staking/module.go b/x/ccv/democracy/staking/module.go index 78489a0166..3e176aaa2c 100644 --- a/x/ccv/democracy/staking/module.go +++ b/x/ccv/democracy/staking/module.go @@ -3,7 +3,6 @@ package staking import ( "encoding/json" - abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" @@ -11,6 +10,8 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking/exported" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/types" + + abci "github.com/cometbft/cometbft/abci/types" ) // Note: for a democracy consumer, this "democracy staking" keeper is only for governance capabilities, diff --git a/x/ccv/provider/client/cli/tx.go b/x/ccv/provider/client/cli/tx.go index ca167dbb60..7e0609d74c 100644 --- a/x/ccv/provider/client/cli/tx.go +++ b/x/ccv/provider/client/cli/tx.go @@ -9,9 +9,9 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ) diff --git a/x/ccv/provider/client/proposal_handler.go b/x/ccv/provider/client/proposal_handler.go index 9c02dd3c23..8ec6e89bfd 100644 --- a/x/ccv/provider/client/proposal_handler.go +++ b/x/ccv/provider/client/proposal_handler.go @@ -8,6 +8,9 @@ import ( "path/filepath" "time" + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" @@ -16,9 +19,8 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" - "github.com/spf13/cobra" ) var ( diff --git a/x/ccv/provider/handler.go b/x/ccv/provider/handler.go index 6f3bb29092..71da622fce 100644 --- a/x/ccv/provider/handler.go +++ b/x/ccv/provider/handler.go @@ -2,8 +2,10 @@ package provider import ( errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/interchain-security/v3/x/ccv/provider/keeper" "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ) diff --git a/x/ccv/provider/handler_test.go b/x/ccv/provider/handler_test.go index 8871d15669..e4835cf14a 100644 --- a/x/ccv/provider/handler_test.go +++ b/x/ccv/provider/handler_test.go @@ -5,13 +5,15 @@ import ( "strings" "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + testcrypto "github.com/cosmos/interchain-security/v3/testutil/crypto" testkeeper "github.com/cosmos/interchain-security/v3/testutil/keeper" "github.com/cosmos/interchain-security/v3/x/ccv/provider" diff --git a/x/ccv/provider/ibc_module.go b/x/ccv/provider/ibc_module.go index 698d37385b..efe113f895 100644 --- a/x/ccv/provider/ibc_module.go +++ b/x/ccv/provider/ibc_module.go @@ -3,16 +3,17 @@ package provider import ( "fmt" - errorsmod "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" host "github.com/cosmos/ibc-go/v7/modules/core/24-host" ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" + errorsmod "cosmossdk.io/errors" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + "github.com/cosmos/interchain-security/v3/x/ccv/provider/keeper" providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" diff --git a/x/ccv/provider/ibc_module_test.go b/x/ccv/provider/ibc_module_test.go index 96e0eb97d1..8b7c3f985c 100644 --- a/x/ccv/provider/ibc_module_test.go +++ b/x/ccv/provider/ibc_module_test.go @@ -3,24 +3,23 @@ package provider_test import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" host "github.com/cosmos/ibc-go/v7/modules/core/24-host" ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + "github.com/golang/mock/gomock" + "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" testkeeper "github.com/cosmos/interchain-security/v3/testutil/keeper" "github.com/cosmos/interchain-security/v3/x/ccv/provider" providerkeeper "github.com/cosmos/interchain-security/v3/x/ccv/provider/keeper" providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" - - "github.com/golang/mock/gomock" - "github.com/stretchr/testify/require" ) // TestOnChanOpenInit tests the provider's OnChanOpenInit method against spec. diff --git a/x/ccv/provider/keeper/distribution.go b/x/ccv/provider/keeper/distribution.go index ee6070e27b..a1dff6faf4 100644 --- a/x/ccv/provider/keeper/distribution.go +++ b/x/ccv/provider/keeper/distribution.go @@ -2,6 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" + consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ) diff --git a/x/ccv/provider/keeper/distribution_test.go b/x/ccv/provider/keeper/distribution_test.go index 4188eedaef..a470feea74 100644 --- a/x/ccv/provider/keeper/distribution_test.go +++ b/x/ccv/provider/keeper/distribution_test.go @@ -3,12 +3,14 @@ package keeper_test import ( "testing" + "github.com/golang/mock/gomock" + "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" + testutil "github.com/cosmos/interchain-security/v3/testutil/keeper" consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" - "github.com/golang/mock/gomock" - "github.com/stretchr/testify/require" ) // TestRegisterConsumerRewardDenom tests the RegisterConsumerRewardDenom method. diff --git a/x/ccv/provider/keeper/genesis.go b/x/ccv/provider/keeper/genesis.go index 996b73d4a5..b3a0a1ef04 100644 --- a/x/ccv/provider/keeper/genesis.go +++ b/x/ccv/provider/keeper/genesis.go @@ -4,6 +4,7 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" ) diff --git a/x/ccv/provider/keeper/genesis_test.go b/x/ccv/provider/keeper/genesis_test.go index fe666dcc2c..d9147ce98f 100644 --- a/x/ccv/provider/keeper/genesis_test.go +++ b/x/ccv/provider/keeper/genesis_test.go @@ -4,17 +4,18 @@ import ( "testing" "time" - sdk "github.com/cosmos/cosmos-sdk/types" host "github.com/cosmos/ibc-go/v7/modules/core/24-host" + "github.com/golang/mock/gomock" + "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/interchain-security/v3/testutil/crypto" testkeeper "github.com/cosmos/interchain-security/v3/testutil/keeper" - consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" "github.com/cosmos/interchain-security/v3/x/ccv/provider/keeper" providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" - "github.com/golang/mock/gomock" - "github.com/stretchr/testify/require" ) // TestInitAndExportGenesis tests the export and the initialisation of a provider chain genesis diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index f43761fd0e..2b522ea9ef 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -4,12 +4,15 @@ import ( "context" "fmt" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) var _ types.QueryServer = Keeper{} diff --git a/x/ccv/provider/keeper/hooks.go b/x/ccv/provider/keeper/hooks.go index 2f2cb8ee0b..35c9b96301 100644 --- a/x/ccv/provider/keeper/hooks.go +++ b/x/ccv/provider/keeper/hooks.go @@ -1,9 +1,9 @@ package keeper import ( + sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - sdk "github.com/cosmos/cosmos-sdk/types" providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/types" ) diff --git a/x/ccv/provider/keeper/hooks_test.go b/x/ccv/provider/keeper/hooks_test.go index 463ed5fff5..83dbfe9622 100644 --- a/x/ccv/provider/keeper/hooks_test.go +++ b/x/ccv/provider/keeper/hooks_test.go @@ -3,11 +3,13 @@ package keeper_test import ( "testing" + "github.com/golang/mock/gomock" + sdk "github.com/cosmos/cosmos-sdk/types" + cryptotestutil "github.com/cosmos/interchain-security/v3/testutil/crypto" testkeeper "github.com/cosmos/interchain-security/v3/testutil/keeper" providerkeeper "github.com/cosmos/interchain-security/v3/x/ccv/provider/keeper" - "github.com/golang/mock/gomock" ) func TestValidatorConsensusKeyInUse(t *testing.T) { diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 03caf0aba5..73785f1c17 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -6,25 +6,26 @@ import ( "reflect" "time" + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + host "github.com/cosmos/ibc-go/v7/modules/core/24-host" + ibchost "github.com/cosmos/ibc-go/v7/modules/core/exported" + ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - host "github.com/cosmos/ibc-go/v7/modules/core/24-host" - ibchost "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + "github.com/cometbft/cometbft/libs/log" consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" - - "github.com/cometbft/cometbft/libs/log" ) // Keeper defines the Cross-Chain Validation Provider Keeper diff --git a/x/ccv/provider/keeper/keeper_test.go b/x/ccv/provider/keeper/keeper_test.go index f34bf262a5..364aac5669 100644 --- a/x/ccv/provider/keeper/keeper_test.go +++ b/x/ccv/provider/keeper/keeper_test.go @@ -6,17 +6,18 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + abci "github.com/cometbft/cometbft/abci/types" tmprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" ibcsimapp "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/simapp" cryptotestutil "github.com/cosmos/interchain-security/v3/testutil/crypto" testkeeper "github.com/cosmos/interchain-security/v3/testutil/keeper" "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" - - "github.com/stretchr/testify/require" ) const consumer = "consumer" diff --git a/x/ccv/provider/keeper/key_assignment.go b/x/ccv/provider/keeper/key_assignment.go index eb4fecd64f..d440848bbf 100644 --- a/x/ccv/provider/keeper/key_assignment.go +++ b/x/ccv/provider/keeper/key_assignment.go @@ -4,14 +4,15 @@ import ( "fmt" errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" - ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/types" - abci "github.com/cometbft/cometbft/abci/types" tmprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + + "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" + ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/types" ) // GetValidatorConsumerPubKey returns a validator's public key assigned for a consumer chain diff --git a/x/ccv/provider/keeper/key_assignment_test.go b/x/ccv/provider/keeper/key_assignment_test.go index 49ef8698cb..8da633a5c9 100644 --- a/x/ccv/provider/keeper/key_assignment_test.go +++ b/x/ccv/provider/keeper/key_assignment_test.go @@ -7,18 +7,20 @@ import ( "testing" "time" - abci "github.com/cometbft/cometbft/abci/types" - tmprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + "github.com/golang/mock/gomock" + "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + abci "github.com/cometbft/cometbft/abci/types" + tmprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + cryptotestutil "github.com/cosmos/interchain-security/v3/testutil/crypto" testkeeper "github.com/cosmos/interchain-security/v3/testutil/keeper" - "github.com/stretchr/testify/require" - providerkeeper "github.com/cosmos/interchain-security/v3/x/ccv/provider/keeper" "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/types" - "github.com/golang/mock/gomock" ) func TestValidatorConsumerPubKeyCRUD(t *testing.T) { diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index d7051cc392..195e2a7215 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -4,11 +4,13 @@ import ( "context" "encoding/base64" - tmprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - errorsmod "cosmossdk.io/errors" + tmprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/types" ) diff --git a/x/ccv/provider/keeper/params.go b/x/ccv/provider/keeper/params.go index adfc574ba9..b7b53b245b 100644 --- a/x/ccv/provider/keeper/params.go +++ b/x/ccv/provider/keeper/params.go @@ -3,10 +3,10 @@ package keeper import ( "time" - sdk "github.com/cosmos/cosmos-sdk/types" - ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/types" ) diff --git a/x/ccv/provider/keeper/params_test.go b/x/ccv/provider/keeper/params_test.go index cfaec35dc7..05b3964bb7 100644 --- a/x/ccv/provider/keeper/params_test.go +++ b/x/ccv/provider/keeper/params_test.go @@ -4,14 +4,15 @@ import ( "testing" "time" - sdk "github.com/cosmos/cosmos-sdk/types" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" testkeeper "github.com/cosmos/interchain-security/v3/testutil/keeper" providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" - "github.com/stretchr/testify/require" ) // TestParams tests the getting/setting of provider ccv module params. diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index 0ce71d6efc..11909ad685 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -5,17 +5,19 @@ import ( "strconv" "time" + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" + ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" errorsmod "cosmossdk.io/errors" - abci "github.com/cometbft/cometbft/abci/types" - tmtypes "github.com/cometbft/cometbft/types" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" - ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + + abci "github.com/cometbft/cometbft/abci/types" + tmtypes "github.com/cometbft/cometbft/types" consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" diff --git a/x/ccv/provider/keeper/proposal_test.go b/x/ccv/provider/keeper/proposal_test.go index 1170a0f368..4e9ee3f4ea 100644 --- a/x/ccv/provider/keeper/proposal_test.go +++ b/x/ccv/provider/keeper/proposal_test.go @@ -7,16 +7,17 @@ import ( "testing" "time" - abci "github.com/cometbft/cometbft/abci/types" - sdk "github.com/cosmos/cosmos-sdk/types" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" _go "github.com/cosmos/ics23/go" "github.com/golang/mock/gomock" - "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" + evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" + + abci "github.com/cometbft/cometbft/abci/types" + cryptoutil "github.com/cosmos/interchain-security/v3/testutil/crypto" testkeeper "github.com/cosmos/interchain-security/v3/testutil/keeper" consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" diff --git a/x/ccv/provider/keeper/relay.go b/x/ccv/provider/keeper/relay.go index 350bc968d4..df4fdb98ce 100644 --- a/x/ccv/provider/keeper/relay.go +++ b/x/ccv/provider/keeper/relay.go @@ -4,13 +4,15 @@ import ( "fmt" "strconv" - errorsmod "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" "github.com/cosmos/ibc-go/v7/modules/core/exported" + errorsmod "cosmossdk.io/errors" + + sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" ) diff --git a/x/ccv/provider/keeper/relay_test.go b/x/ccv/provider/keeper/relay_test.go index 15305d8eea..b266211a42 100644 --- a/x/ccv/provider/keeper/relay_test.go +++ b/x/ccv/provider/keeper/relay_test.go @@ -4,13 +4,17 @@ import ( "testing" "time" - abci "github.com/cometbft/cometbft/abci/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" exported "github.com/cosmos/ibc-go/v7/modules/core/exported" + "github.com/golang/mock/gomock" + "github.com/stretchr/testify/require" + + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + abci "github.com/cometbft/cometbft/abci/types" ibcsimapp "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/simapp" cryptotestutil "github.com/cosmos/interchain-security/v3/testutil/crypto" @@ -18,9 +22,6 @@ import ( "github.com/cosmos/interchain-security/v3/x/ccv/provider/keeper" providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" - "github.com/golang/mock/gomock" - - "github.com/stretchr/testify/require" ) // TestQueueVSCPackets tests queueing validator set updates. diff --git a/x/ccv/provider/keeper/throttle.go b/x/ccv/provider/keeper/throttle.go index ddfe1b1763..d8be629ee7 100644 --- a/x/ccv/provider/keeper/throttle.go +++ b/x/ccv/provider/keeper/throttle.go @@ -5,9 +5,11 @@ import ( "time" "cosmossdk.io/math" - tmtypes "github.com/cometbft/cometbft/types" + sdktypes "github.com/cosmos/cosmos-sdk/types" + tmtypes "github.com/cometbft/cometbft/types" + providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/types" ) diff --git a/x/ccv/provider/keeper/throttle_test.go b/x/ccv/provider/keeper/throttle_test.go index f923c53e98..a5356b0dc0 100644 --- a/x/ccv/provider/keeper/throttle_test.go +++ b/x/ccv/provider/keeper/throttle_test.go @@ -5,14 +5,15 @@ import ( "testing" "time" + "github.com/golang/mock/gomock" + "github.com/stretchr/testify/require" + "golang.org/x/exp/slices" + "cosmossdk.io/math" - tmtypes "github.com/cometbft/cometbft/types" sdktypes "github.com/cosmos/cosmos-sdk/types" - "github.com/golang/mock/gomock" - "github.com/stretchr/testify/require" - "golang.org/x/exp/slices" + tmtypes "github.com/cometbft/cometbft/types" cryptoutil "github.com/cosmos/interchain-security/v3/testutil/crypto" testkeeper "github.com/cosmos/interchain-security/v3/testutil/keeper" diff --git a/x/ccv/provider/module.go b/x/ccv/provider/module.go index 556cbcfefa..82891c27c7 100644 --- a/x/ccv/provider/module.go +++ b/x/ccv/provider/module.go @@ -5,23 +5,23 @@ import ( "encoding/json" "fmt" - abci "github.com/cometbft/cometbft/abci/types" + porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" + abci "github.com/cometbft/cometbft/abci/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/cosmos/interchain-security/v3/x/ccv/provider/client/cli" "github.com/cosmos/interchain-security/v3/x/ccv/provider/keeper" providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" - - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" ) var ( diff --git a/x/ccv/provider/module_test.go b/x/ccv/provider/module_test.go index 0eee81cc1f..f32cb8cc4d 100644 --- a/x/ccv/provider/module_test.go +++ b/x/ccv/provider/module_test.go @@ -3,19 +3,18 @@ package provider_test import ( "testing" + host "github.com/cosmos/ibc-go/v7/modules/core/24-host" + "github.com/golang/mock/gomock" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - host "github.com/cosmos/ibc-go/v7/modules/core/24-host" - testkeeper "github.com/cosmos/interchain-security/v3/testutil/keeper" "github.com/cosmos/interchain-security/v3/x/ccv/provider" "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/golang/mock/gomock" ) // Tests the provider's InitGenesis implementation against the spec. diff --git a/x/ccv/provider/proposal_handler.go b/x/ccv/provider/proposal_handler.go index ebebb9c967..137cbecec7 100644 --- a/x/ccv/provider/proposal_handler.go +++ b/x/ccv/provider/proposal_handler.go @@ -1,11 +1,12 @@ package provider import ( - govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/cosmos/interchain-security/v3/x/ccv/provider/keeper" "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ) diff --git a/x/ccv/provider/proposal_handler_test.go b/x/ccv/provider/proposal_handler_test.go index a85853a246..d3707d8c28 100644 --- a/x/ccv/provider/proposal_handler_test.go +++ b/x/ccv/provider/proposal_handler_test.go @@ -4,14 +4,13 @@ import ( "testing" "time" - sdk "github.com/cosmos/cosmos-sdk/types" - distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - + sdk "github.com/cosmos/cosmos-sdk/types" + distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" testkeeper "github.com/cosmos/interchain-security/v3/testutil/keeper" diff --git a/x/ccv/provider/types/genesis.go b/x/ccv/provider/types/genesis.go index 5a9358e736..07c135ebfc 100644 --- a/x/ccv/provider/types/genesis.go +++ b/x/ccv/provider/types/genesis.go @@ -3,9 +3,11 @@ package types import ( "fmt" + host "github.com/cosmos/ibc-go/v7/modules/core/24-host" + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" - host "github.com/cosmos/ibc-go/v7/modules/core/24-host" ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" ) diff --git a/x/ccv/provider/types/genesis_test.go b/x/ccv/provider/types/genesis_test.go index de5c77a803..dbff6a1c2f 100644 --- a/x/ccv/provider/types/genesis_test.go +++ b/x/ccv/provider/types/genesis_test.go @@ -4,19 +4,20 @@ import ( "testing" "time" - abci "github.com/cometbft/cometbft/abci/types" - tmtypes "github.com/cometbft/cometbft/types" - sdk "github.com/cosmos/cosmos-sdk/types" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" + + abci "github.com/cometbft/cometbft/abci/types" + tmtypes "github.com/cometbft/cometbft/types" "github.com/cosmos/interchain-security/v3/testutil/crypto" consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" - - "github.com/stretchr/testify/require" ) // Tests validation of consumer states and params within a provider genesis state diff --git a/x/ccv/provider/types/key_assignment.go b/x/ccv/provider/types/key_assignment.go index 659ca91e83..78e5161a55 100644 --- a/x/ccv/provider/types/key_assignment.go +++ b/x/ccv/provider/types/key_assignment.go @@ -5,7 +5,9 @@ import ( "strings" errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/types" ) diff --git a/x/ccv/provider/types/keys_test.go b/x/ccv/provider/types/keys_test.go index 3bb891ddce..9f470f4a82 100644 --- a/x/ccv/provider/types/keys_test.go +++ b/x/ccv/provider/types/keys_test.go @@ -4,10 +4,12 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" + cryptoutil "github.com/cosmos/interchain-security/v3/testutil/crypto" providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" - "github.com/stretchr/testify/require" ) // Tests that all singular keys, or prefixes to fully resolves keys are non duplicate byte values. diff --git a/x/ccv/provider/types/params.go b/x/ccv/provider/types/params.go index 0495d1a89e..515d8954ec 100644 --- a/x/ccv/provider/types/params.go +++ b/x/ccv/provider/types/params.go @@ -4,13 +4,13 @@ import ( "fmt" "time" - sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + sdk "github.com/cosmos/cosmos-sdk/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/types" ) diff --git a/x/ccv/provider/types/params_test.go b/x/ccv/provider/types/params_test.go index 7a4b9aabf2..0676a15986 100644 --- a/x/ccv/provider/types/params_test.go +++ b/x/ccv/provider/types/params_test.go @@ -4,12 +4,13 @@ import ( "testing" "time" - "github.com/stretchr/testify/require" - - sdk "github.com/cosmos/cosmos-sdk/types" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ) diff --git a/x/ccv/provider/types/proposal.go b/x/ccv/provider/types/proposal.go index 89e8cb9822..c369ec95f1 100644 --- a/x/ccv/provider/types/proposal.go +++ b/x/ccv/provider/types/proposal.go @@ -6,10 +6,12 @@ import ( "strings" time "time" + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + errorsmod "cosmossdk.io/errors" + evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/types" ) diff --git a/x/ccv/provider/types/proposal_test.go b/x/ccv/provider/types/proposal_test.go index b3f27e1415..fac4c7fc4b 100644 --- a/x/ccv/provider/types/proposal_test.go +++ b/x/ccv/provider/types/proposal_test.go @@ -5,19 +5,17 @@ import ( "testing" "time" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" "github.com/golang/protobuf/proto" //nolint:staticcheck // see: https://github.com/cosmos/interchain-security/issues/236 "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" + evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ) diff --git a/x/ccv/types/ccv.go b/x/ccv/types/ccv.go index e7739b4c2f..f02ed1c450 100644 --- a/x/ccv/types/ccv.go +++ b/x/ccv/types/ccv.go @@ -4,8 +4,10 @@ import ( "fmt" errorsmod "cosmossdk.io/errors" - abci "github.com/cometbft/cometbft/abci/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + abci "github.com/cometbft/cometbft/abci/types" ) func NewValidatorSetChangePacketData(valUpdates []abci.ValidatorUpdate, valUpdateID uint64, slashAcks []string) ValidatorSetChangePacketData { diff --git a/x/ccv/types/ccv_test.go b/x/ccv/types/ccv_test.go index 5aadafe6ec..596967b199 100644 --- a/x/ccv/types/ccv_test.go +++ b/x/ccv/types/ccv_test.go @@ -3,11 +3,14 @@ package types_test import ( "testing" - abci "github.com/cometbft/cometbft/abci/types" + "github.com/stretchr/testify/require" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cosmos/interchain-security/v3/x/ccv/types" - "github.com/stretchr/testify/require" ) func TestPacketDataValidateBasic(t *testing.T) { diff --git a/x/ccv/types/expected_keepers.go b/x/ccv/types/expected_keepers.go index 8176d193b2..2a82561cf0 100644 --- a/x/ccv/types/expected_keepers.go +++ b/x/ccv/types/expected_keepers.go @@ -4,18 +4,20 @@ import ( context "context" "time" + transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" auth "github.com/cosmos/cosmos-sdk/x/auth/types" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" abci "github.com/cometbft/cometbft/abci/types" ) diff --git a/x/ccv/types/shared_params.go b/x/ccv/types/shared_params.go index 8ff676bded..566737c0b9 100644 --- a/x/ccv/types/shared_params.go +++ b/x/ccv/types/shared_params.go @@ -4,8 +4,9 @@ import ( fmt "fmt" "time" - sdktypes "github.com/cosmos/cosmos-sdk/types" ibchost "github.com/cosmos/ibc-go/v7/modules/core/24-host" + + sdktypes "github.com/cosmos/cosmos-sdk/types" ) const ( diff --git a/x/ccv/types/utils.go b/x/ccv/types/utils.go index 524725a532..f6e7ffc3aa 100644 --- a/x/ccv/types/utils.go +++ b/x/ccv/types/utils.go @@ -5,14 +5,17 @@ import ( "sort" "time" - errorsmod "cosmossdk.io/errors" - abci "github.com/cometbft/cometbft/abci/types" - tmprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - sdk "github.com/cosmos/cosmos-sdk/types" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" host "github.com/cosmos/ibc-go/v7/modules/core/24-host" + + errorsmod "cosmossdk.io/errors" + + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + + abci "github.com/cometbft/cometbft/abci/types" + tmprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" ) func AccumulateChanges(currentChanges, newChanges []abci.ValidatorUpdate) []abci.ValidatorUpdate { diff --git a/x/ccv/types/utils_test.go b/x/ccv/types/utils_test.go index 0182b68306..f43e5449f1 100644 --- a/x/ccv/types/utils_test.go +++ b/x/ccv/types/utils_test.go @@ -3,11 +3,14 @@ package types_test import ( "testing" - abci "github.com/cometbft/cometbft/abci/types" + "github.com/stretchr/testify/require" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + + abci "github.com/cometbft/cometbft/abci/types" + ibcsimapp "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/simapp" "github.com/cosmos/interchain-security/v3/x/ccv/types" - "github.com/stretchr/testify/require" ) func TestAccumulateChanges(t *testing.T) {