From d86a63f44f5d600f430c847961668e94fb2a9ff8 Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Fri, 20 Jan 2023 05:01:36 -0800 Subject: [PATCH] Bump IBC refs to ver 4.2.0 (#654) * Update gitignore * Add ibc testing folder * WIP replacing ibcsim * Tests pass * Update ibc-go dependency * Remove TODOs * Remove unused code * Fixes ibcsim simapp dep * Remove unneeded simapp code from #632 (#636) delete code * Fix lint * Update dependencies and linters * Test gosec ignore * Fix gosec * Fix linting * Update sonarcloud ignore for ibc * Revert lint change * Removed unused code * Refactor ibc directory * Add back gaia tests and add ibc-testing disclosure * wip * compiles * tests pass * todos * fix codeql file indentation * 2nd attempt to fix codeql * 3rd attempt * update OnChanOpenInit version handling to follow ics26 * revert module version * remove version checking in provider OnChanOpenInit * address left TODOs Co-authored-by: lg Co-authored-by: Daniel Co-authored-by: lg <8335464+glnro@users.noreply.github.com> Co-authored-by: Simon Noetzlin Co-authored-by: Marius Poke --- .github/workflows/codeql.yml | 8 ++-- app/consumer-democracy/ante_handler.go | 4 +- app/consumer-democracy/app.go | 18 ++++----- .../proposals_whitelisting.go | 2 +- .../ante/disabled_modules_ante_test.go | 2 +- app/consumer/ante/msg_filter_ante_test.go | 2 +- app/consumer/ante_handler.go | 4 +- app/consumer/app.go | 16 ++++---- app/provider/ante_handler.go | 4 +- app/provider/app.go | 22 +++++------ go.mod | 2 +- go.sum | 4 +- legacy_ibc_testing/core/events.go | 4 +- legacy_ibc_testing/testing/app.go | 2 +- legacy_ibc_testing/testing/chain.go | 16 ++++---- legacy_ibc_testing/testing/config.go | 10 ++--- legacy_ibc_testing/testing/endpoint.go | 34 ++++++++++------- legacy_ibc_testing/testing/events.go | 6 +-- legacy_ibc_testing/testing/path.go | 2 +- legacy_ibc_testing/testing/values.go | 8 ++-- tests/difference/core/driver/core_test.go | 2 +- .../core/driver/seed_gen_fuzzy_test.go | 2 +- tests/difference/core/driver/setup.go | 10 ++--- tests/e2e/common.go | 10 ++--- tests/e2e/distribution.go | 2 +- tests/e2e/expired_client.go | 6 +-- tests/e2e/key_assignment.go | 2 +- tests/e2e/setup.go | 8 ++-- tests/e2e/slashing.go | 20 +++++----- tests/e2e/stop_consumer.go | 2 +- tests/e2e/throttle.go | 2 +- tests/e2e/valset_update.go | 4 +- tests/integration/actions.go | 2 +- tests/integration/state.go | 2 +- tests/integration/steps_start_chains.go | 2 +- testutil/crypto/crypto.go | 2 +- testutil/ibc_testing/generic_setup.go | 2 +- testutil/keeper/expectations.go | 10 ++--- testutil/keeper/mocks.go | 8 ++-- testutil/keeper/unit_test_helpers.go | 2 +- testutil/simibc/chain_util.go | 4 +- testutil/simibc/ordered_link.go | 2 +- testutil/simibc/relay_util.go | 8 ++-- testutil/simibc/relayed_path.go | 2 +- .../proto/ibc/core/channel/v1/channel.proto | 2 +- .../proto/ibc/core/channel/v1/genesis.proto | 2 +- .../proto/ibc/core/channel/v1/query.proto | 2 +- .../proto/ibc/core/channel/v1/tx.proto | 2 +- .../proto/ibc/core/client/v1/client.proto | 2 +- .../proto/ibc/core/client/v1/genesis.proto | 2 +- .../proto/ibc/core/client/v1/query.proto | 2 +- third_party/proto/ibc/core/client/v1/tx.proto | 2 +- .../ibc/core/commitment/v1/commitment.proto | 2 +- .../ibc/core/connection/v1/connection.proto | 2 +- .../ibc/core/connection/v1/genesis.proto | 2 +- .../proto/ibc/core/connection/v1/query.proto | 2 +- .../proto/ibc/core/connection/v1/tx.proto | 2 +- .../proto/ibc/core/types/v1/genesis.proto | 2 +- .../lightclients/localhost/v1/localhost.proto | 2 +- .../solomachine/v1/solomachine.proto | 2 +- .../solomachine/v2/solomachine.proto | 2 +- .../tendermint/v1/tendermint.proto | 2 +- x/ccv/consumer/ibc_module.go | 38 +++++++++++++------ x/ccv/consumer/ibc_module_test.go | 31 ++++++++++++--- x/ccv/consumer/keeper/distribution.go | 6 +-- x/ccv/consumer/keeper/genesis_test.go | 6 +-- x/ccv/consumer/keeper/keeper.go | 8 ++-- x/ccv/consumer/keeper/keeper_test.go | 2 +- x/ccv/consumer/keeper/relay.go | 6 +-- x/ccv/consumer/keeper/relay_test.go | 9 +++-- x/ccv/consumer/module.go | 3 +- x/ccv/consumer/types/genesis.go | 2 +- x/ccv/consumer/types/genesis.pb.go | 4 +- x/ccv/consumer/types/genesis_test.go | 6 +-- x/ccv/provider/client/proposal_handler.go | 2 +- x/ccv/provider/ibc_module.go | 19 +++++----- x/ccv/provider/ibc_module_test.go | 10 ++--- x/ccv/provider/keeper/genesis_test.go | 2 +- x/ccv/provider/keeper/keeper.go | 12 +++--- x/ccv/provider/keeper/params.go | 2 +- x/ccv/provider/keeper/params_test.go | 6 +-- x/ccv/provider/keeper/proposal.go | 8 ++-- x/ccv/provider/keeper/proposal_test.go | 4 +- x/ccv/provider/keeper/relay.go | 12 +++--- x/ccv/provider/keeper/relay_test.go | 6 +-- x/ccv/provider/module.go | 9 ++--- x/ccv/provider/module_test.go | 2 +- x/ccv/provider/proposal_handler_test.go | 2 +- x/ccv/provider/types/genesis.go | 2 +- x/ccv/provider/types/genesis_test.go | 6 +-- x/ccv/provider/types/params.go | 6 +-- x/ccv/provider/types/params_test.go | 6 +-- x/ccv/provider/types/proposal.go | 2 +- x/ccv/provider/types/proposal_test.go | 4 +- x/ccv/provider/types/provider.pb.go | 4 +- x/ccv/types/expected_keepers.go | 8 ++-- x/ccv/types/shared_params.go | 2 +- x/ccv/utils/utils.go | 6 +-- 98 files changed, 314 insertions(+), 271 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index b518f62dc5..f4f80b4863 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -3,10 +3,12 @@ name: "CodeQL" on: push: branches: [main] + paths-ignore: + - 'legacy_ibc_testing' pull_request: branches: [main] - paths-ignore: - - "legacy_ibc_testing" + paths-ignore: + - 'legacy_ibc_testing' schedule: # ┌───────────── minute (0 - 59) # │ ┌───────────── hour (0 - 23) @@ -60,4 +62,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v2 \ No newline at end of file diff --git a/app/consumer-democracy/ante_handler.go b/app/consumer-democracy/ante_handler.go index efe984faf0..9a7e4b1c72 100644 --- a/app/consumer-democracy/ante_handler.go +++ b/app/consumer-democracy/ante_handler.go @@ -4,8 +4,8 @@ import ( 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/v3/modules/core/ante" - ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper" + ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante" + ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper" democracyante "github.com/cosmos/interchain-security/app/consumer-democracy/ante" consumerante "github.com/cosmos/interchain-security/app/consumer/ante" ibcconsumerkeeper "github.com/cosmos/interchain-security/x/ccv/consumer/keeper" diff --git a/app/consumer-democracy/app.go b/app/consumer-democracy/app.go index be4b54848e..72ca112743 100644 --- a/app/consumer-democracy/app.go +++ b/app/consumer-democracy/app.go @@ -61,14 +61,14 @@ 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/v3/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v3/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v3/modules/core" - ibcconnectiontypes "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types" - porttypes "github.com/cosmos/ibc-go/v3/modules/core/05-port/types" - ibchost "github.com/cosmos/ibc-go/v3/modules/core/24-host" - ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper" + "github.com/cosmos/ibc-go/v4/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/v4/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v4/modules/core" + ibcconnectiontypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types" + porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types" + ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host" + ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper" ibctestingcore "github.com/cosmos/interchain-security/legacy_ibc_testing/core" ibctesting "github.com/cosmos/interchain-security/legacy_ibc_testing/testing" "github.com/gorilla/mux" @@ -394,7 +394,7 @@ func New( app.GovKeeper = *govKeeper.SetHooks( ccvgovtypes.NewMultiGovHooks( - // register the governance hooks + // register the governance hooks ), ) diff --git a/app/consumer-democracy/proposals_whitelisting.go b/app/consumer-democracy/proposals_whitelisting.go index 3519d8d7ac..337e141ce6 100644 --- a/app/consumer-democracy/proposals_whitelisting.go +++ b/app/consumer-democracy/proposals_whitelisting.go @@ -7,7 +7,7 @@ import ( minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/cosmos/cosmos-sdk/x/params/types/proposal" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" + ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" ) func IsProposalWhitelisted(content govtypes.Content) bool { diff --git a/app/consumer/ante/disabled_modules_ante_test.go b/app/consumer/ante/disabled_modules_ante_test.go index 08dfc23bb3..31316f5856 100644 --- a/app/consumer/ante/disabled_modules_ante_test.go +++ b/app/consumer/ante/disabled_modules_ante_test.go @@ -7,7 +7,7 @@ import ( 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/v3/modules/core/02-client/types" + ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" appconsumer "github.com/cosmos/interchain-security/app/consumer" "github.com/cosmos/interchain-security/app/consumer/ante" "github.com/stretchr/testify/require" diff --git a/app/consumer/ante/msg_filter_ante_test.go b/app/consumer/ante/msg_filter_ante_test.go index 6fb1f08955..517415147c 100644 --- a/app/consumer/ante/msg_filter_ante_test.go +++ b/app/consumer/ante/msg_filter_ante_test.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - ibcclienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" + ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" appconsumer "github.com/cosmos/interchain-security/app/consumer" "github.com/cosmos/interchain-security/app/consumer/ante" "github.com/stretchr/testify/require" diff --git a/app/consumer/ante_handler.go b/app/consumer/ante_handler.go index 5e282ae06a..4e4df1fe48 100644 --- a/app/consumer/ante_handler.go +++ b/app/consumer/ante_handler.go @@ -4,8 +4,8 @@ import ( 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/v3/modules/core/ante" - ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper" + ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante" + ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper" consumerante "github.com/cosmos/interchain-security/app/consumer/ante" ibcconsumerkeeper "github.com/cosmos/interchain-security/x/ccv/consumer/keeper" ) diff --git a/app/consumer/app.go b/app/consumer/app.go index 2c2652b4cd..00cfe5b27d 100644 --- a/app/consumer/app.go +++ b/app/consumer/app.go @@ -58,14 +58,14 @@ 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/v3/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v3/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v3/modules/core" - ibcconnectiontypes "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types" - porttypes "github.com/cosmos/ibc-go/v3/modules/core/05-port/types" - ibchost "github.com/cosmos/ibc-go/v3/modules/core/24-host" - ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper" + "github.com/cosmos/ibc-go/v4/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/v4/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v4/modules/core" + ibcconnectiontypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types" + porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types" + ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host" + ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper" ibctestingcore "github.com/cosmos/interchain-security/legacy_ibc_testing/core" ibctesting "github.com/cosmos/interchain-security/legacy_ibc_testing/testing" "github.com/gorilla/mux" diff --git a/app/provider/ante_handler.go b/app/provider/ante_handler.go index 9672de45f8..3c468ce840 100644 --- a/app/provider/ante_handler.go +++ b/app/provider/ante_handler.go @@ -4,8 +4,8 @@ import ( 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/v3/modules/core/ante" - ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper" + ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante" + ibckeeper "github.com/cosmos/ibc-go/v4/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 a7a247ac06..2df7db954e 100644 --- a/app/provider/app.go +++ b/app/provider/app.go @@ -76,17 +76,17 @@ 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/v3/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v3/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v3/modules/core" - ibcclient "github.com/cosmos/ibc-go/v3/modules/core/02-client" - ibcclientclient "github.com/cosmos/ibc-go/v3/modules/core/02-client/client" - ibcclienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - ibcconnectiontypes "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types" - porttypes "github.com/cosmos/ibc-go/v3/modules/core/05-port/types" - ibchost "github.com/cosmos/ibc-go/v3/modules/core/24-host" - ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper" + "github.com/cosmos/ibc-go/v4/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/v4/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v4/modules/core" + ibcclient "github.com/cosmos/ibc-go/v4/modules/core/02-client" + ibcclientclient "github.com/cosmos/ibc-go/v4/modules/core/02-client/client" + ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + ibcconnectiontypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types" + porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types" + ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host" + ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper" ibctestingcore "github.com/cosmos/interchain-security/legacy_ibc_testing/core" ibctesting "github.com/cosmos/interchain-security/legacy_ibc_testing/testing" diff --git a/go.mod b/go.mod index c4c263795b..502c0343b5 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,6 @@ go 1.18 require ( github.com/cosmos/cosmos-sdk v0.45.11 - github.com/cosmos/ibc-go/v3 v3.4.0 github.com/gogo/protobuf v1.3.3 github.com/golang/protobuf v1.5.2 github.com/gorilla/mux v1.8.0 @@ -30,6 +29,7 @@ require ( require ( github.com/confio/ics23/go v0.7.0 + github.com/cosmos/ibc-go/v4 v4.2.0 github.com/golang/mock v1.6.0 github.com/oxyno-zeta/gomock-extra-matcher v1.1.0 github.com/regen-network/cosmos-proto v0.3.1 diff --git a/go.sum b/go.sum index 3e65630c09..39da7bdd49 100644 --- a/go.sum +++ b/go.sum @@ -739,8 +739,8 @@ github.com/cosmos/iavl v0.15.3/go.mod h1:OLjQiAQ4fGD2KDZooyJG9yz+p2ao2IAYSbke8mV github.com/cosmos/iavl v0.19.4 h1:t82sN+Y0WeqxDLJRSpNd8YFX5URIrT+p8n6oJbJ2Dok= github.com/cosmos/iavl v0.19.4/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= github.com/cosmos/ibc-go v1.2.2/go.mod h1:XmYjsRFOs6Q9Cz+CSsX21icNoH27vQKb3squgnCOCbs= -github.com/cosmos/ibc-go/v3 v3.4.0 h1:ha3cqEG36pqMWqA1D+kxDWBTZXpeFMd/aZIQF7I0xro= -github.com/cosmos/ibc-go/v3 v3.4.0/go.mod h1:VwB/vWu4ysT5DN2aF78d17LYmx3omSAdq6gpKvM7XRA= +github.com/cosmos/ibc-go/v4 v4.2.0 h1:Fx/kKq/uvawrAxk6ZrQ6sEIgffLRU5Cs/AUnvpPBrHI= +github.com/cosmos/ibc-go/v4 v4.2.0/go.mod h1:57qWScDtfCx3FOMLYmBIKPbOLE6xiVhrgxHAQmbWYXM= github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4= github.com/cosmos/ledger-cosmos-go v0.11.1/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY= github.com/cosmos/ledger-go v0.9.2/go.mod h1:oZJ2hHAZROdlHiwTg4t7kP+GKIIkBT+o6c9QWFanOyI= diff --git a/legacy_ibc_testing/core/events.go b/legacy_ibc_testing/core/events.go index 893fa89cc3..a810f6cf66 100644 --- a/legacy_ibc_testing/core/events.go +++ b/legacy_ibc_testing/core/events.go @@ -5,8 +5,8 @@ import ( abci "github.com/tendermint/tendermint/abci/types" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" ) /* diff --git a/legacy_ibc_testing/testing/app.go b/legacy_ibc_testing/testing/app.go index 17ca29dd99..0ec80eb819 100644 --- a/legacy_ibc_testing/testing/app.go +++ b/legacy_ibc_testing/testing/app.go @@ -22,7 +22,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmtypes "github.com/tendermint/tendermint/types" - "github.com/cosmos/ibc-go/v3/modules/core/keeper" + "github.com/cosmos/ibc-go/v4/modules/core/keeper" "github.com/cosmos/interchain-security/legacy_ibc_testing/simapp" ) diff --git a/legacy_ibc_testing/testing/chain.go b/legacy_ibc_testing/testing/chain.go index 142957aa4b..a9ce8506fd 100644 --- a/legacy_ibc_testing/testing/chain.go +++ b/legacy_ibc_testing/testing/chain.go @@ -26,14 +26,14 @@ import ( tmtypes "github.com/tendermint/tendermint/types" tmversion "github.com/tendermint/tendermint/version" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" - commitmenttypes "github.com/cosmos/ibc-go/v3/modules/core/23-commitment/types" - host "github.com/cosmos/ibc-go/v3/modules/core/24-host" - "github.com/cosmos/ibc-go/v3/modules/core/exported" - "github.com/cosmos/ibc-go/v3/modules/core/types" - ibctmtypes "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" - "github.com/cosmos/ibc-go/v3/testing/mock" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + commitmenttypes "github.com/cosmos/ibc-go/v4/modules/core/23-commitment/types" + host "github.com/cosmos/ibc-go/v4/modules/core/24-host" + "github.com/cosmos/ibc-go/v4/modules/core/exported" + "github.com/cosmos/ibc-go/v4/modules/core/types" + ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" + "github.com/cosmos/ibc-go/v4/testing/mock" ibctestingcore "github.com/cosmos/interchain-security/legacy_ibc_testing/core" "github.com/cosmos/interchain-security/legacy_ibc_testing/simapp" ) diff --git a/legacy_ibc_testing/testing/config.go b/legacy_ibc_testing/testing/config.go index 847469532e..f9c72f501e 100644 --- a/legacy_ibc_testing/testing/config.go +++ b/legacy_ibc_testing/testing/config.go @@ -3,11 +3,11 @@ package testing import ( "time" - connectiontypes "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" - "github.com/cosmos/ibc-go/v3/modules/core/exported" - ibctmtypes "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" - "github.com/cosmos/ibc-go/v3/testing/mock" + connectiontypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + "github.com/cosmos/ibc-go/v4/modules/core/exported" + ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" + "github.com/cosmos/ibc-go/v4/testing/mock" ) /* diff --git a/legacy_ibc_testing/testing/endpoint.go b/legacy_ibc_testing/testing/endpoint.go index d7b3dc5294..2ce4903fb0 100644 --- a/legacy_ibc_testing/testing/endpoint.go +++ b/legacy_ibc_testing/testing/endpoint.go @@ -6,13 +6,13 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - connectiontypes "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" - commitmenttypes "github.com/cosmos/ibc-go/v3/modules/core/23-commitment/types" - host "github.com/cosmos/ibc-go/v3/modules/core/24-host" - "github.com/cosmos/ibc-go/v3/modules/core/exported" - ibctmtypes "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + connectiontypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + commitmenttypes "github.com/cosmos/ibc-go/v4/modules/core/23-commitment/types" + host "github.com/cosmos/ibc-go/v4/modules/core/24-host" + "github.com/cosmos/ibc-go/v4/modules/core/exported" + ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" ) /* @@ -174,9 +174,13 @@ func (endpoint *Endpoint) ConnOpenTry() error { counterpartyClient, proofClient, proofConsensus, consensusHeight, proofInit, proofHeight := endpoint.QueryConnectionHandshakeProof() msg := connectiontypes.NewMsgConnectionOpenTry( - "", endpoint.ClientID, // does not support handshake continuation - endpoint.Counterparty.ConnectionID, endpoint.Counterparty.ClientID, - counterpartyClient, endpoint.Counterparty.Chain.GetPrefix(), []*connectiontypes.Version{ConnectionVersion}, endpoint.ConnectionConfig.DelayPeriod, + endpoint.ClientID, // does not support handshake continuation + endpoint.Counterparty.ConnectionID, + endpoint.Counterparty.ClientID, + counterpartyClient, + endpoint.Counterparty.Chain.GetPrefix(), + []*connectiontypes.Version{ConnectionVersion}, + endpoint.ConnectionConfig.DelayPeriod, proofInit, proofClient, proofConsensus, proofHeight, consensusHeight, endpoint.Chain.SenderAccount.GetAddress().String(), @@ -284,9 +288,13 @@ func (endpoint *Endpoint) ChanOpenTry() error { proof, height := endpoint.Counterparty.Chain.QueryProof(channelKey) msg := channeltypes.NewMsgChannelOpenTry( - endpoint.ChannelConfig.PortID, "", // does not support handshake continuation - endpoint.ChannelConfig.Version, endpoint.ChannelConfig.Order, []string{endpoint.ConnectionID}, - endpoint.Counterparty.ChannelConfig.PortID, endpoint.Counterparty.ChannelID, endpoint.Counterparty.ChannelConfig.Version, + endpoint.ChannelConfig.PortID, // does not support handshake continuation + endpoint.ChannelConfig.Version, + endpoint.ChannelConfig.Order, + []string{endpoint.ConnectionID}, + endpoint.Counterparty.ChannelConfig.PortID, + endpoint.Counterparty.ChannelID, + endpoint.Counterparty.ChannelConfig.Version, proof, height, endpoint.Chain.SenderAccount.GetAddress().String(), ) diff --git a/legacy_ibc_testing/testing/events.go b/legacy_ibc_testing/testing/events.go index 66f83e4516..98c8d137ff 100644 --- a/legacy_ibc_testing/testing/events.go +++ b/legacy_ibc_testing/testing/events.go @@ -4,9 +4,9 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - connectiontypes "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + connectiontypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" ) /* diff --git a/legacy_ibc_testing/testing/path.go b/legacy_ibc_testing/testing/path.go index 5ba229cb02..910e6d0755 100644 --- a/legacy_ibc_testing/testing/path.go +++ b/legacy_ibc_testing/testing/path.go @@ -4,7 +4,7 @@ import ( "bytes" "fmt" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" ) /* diff --git a/legacy_ibc_testing/testing/values.go b/legacy_ibc_testing/testing/values.go index 35e042b234..105194ca69 100644 --- a/legacy_ibc_testing/testing/values.go +++ b/legacy_ibc_testing/testing/values.go @@ -3,10 +3,10 @@ package testing import ( "time" - ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" - connectiontypes "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types" - ibctmtypes "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" - "github.com/cosmos/ibc-go/v3/testing/mock" + ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" + connectiontypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types" + ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" + "github.com/cosmos/ibc-go/v4/testing/mock" ) /* diff --git a/tests/difference/core/driver/core_test.go b/tests/difference/core/driver/core_test.go index 25752bcf06..743b36b5e2 100644 --- a/tests/difference/core/driver/core_test.go +++ b/tests/difference/core/driver/core_test.go @@ -9,7 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" ibctestingcore "github.com/cosmos/interchain-security/legacy_ibc_testing/core" ibctesting "github.com/cosmos/interchain-security/legacy_ibc_testing/testing" diff --git a/tests/difference/core/driver/seed_gen_fuzzy_test.go b/tests/difference/core/driver/seed_gen_fuzzy_test.go index 3532537a92..592f20da76 100644 --- a/tests/difference/core/driver/seed_gen_fuzzy_test.go +++ b/tests/difference/core/driver/seed_gen_fuzzy_test.go @@ -9,7 +9,7 @@ import ( 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/v3/testing/mock" + mock "github.com/cosmos/ibc-go/v4/testing/mock" tmtypes "github.com/tendermint/tendermint/types" ) diff --git a/tests/difference/core/driver/setup.go b/tests/difference/core/driver/setup.go index 39a9ffe67c..6fcb57bdf8 100644 --- a/tests/difference/core/driver/setup.go +++ b/tests/difference/core/driver/setup.go @@ -16,7 +16,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmtypes "github.com/tendermint/tendermint/types" - "github.com/cosmos/ibc-go/v3/testing/mock" + "github.com/cosmos/ibc-go/v4/testing/mock" ibctestingcore "github.com/cosmos/interchain-security/legacy_ibc_testing/core" ibctesting "github.com/cosmos/interchain-security/legacy_ibc_testing/testing" @@ -28,10 +28,10 @@ import ( cosmosEd25519 "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" - commitmenttypes "github.com/cosmos/ibc-go/v3/modules/core/23-commitment/types" - ibctmtypes "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + commitmenttypes "github.com/cosmos/ibc-go/v4/modules/core/23-commitment/types" + ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" diff --git a/tests/e2e/common.go b/tests/e2e/common.go index 4d64226796..20348ff3ec 100644 --- a/tests/e2e/common.go +++ b/tests/e2e/common.go @@ -8,11 +8,11 @@ import ( 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/v3/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" - commitmenttypes "github.com/cosmos/ibc-go/v3/modules/core/23-commitment/types" - "github.com/cosmos/ibc-go/v3/modules/core/exported" - ibctm "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + commitmenttypes "github.com/cosmos/ibc-go/v4/modules/core/23-commitment/types" + "github.com/cosmos/ibc-go/v4/modules/core/exported" + ibctm "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" ibctesting "github.com/cosmos/interchain-security/legacy_ibc_testing/testing" "github.com/cosmos/interchain-security/testutil/e2e" icstestingutils "github.com/cosmos/interchain-security/testutil/ibc_testing" diff --git a/tests/e2e/distribution.go b/tests/e2e/distribution.go index dd92fad7eb..0c247e14a2 100644 --- a/tests/e2e/distribution.go +++ b/tests/e2e/distribution.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" + transfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" consumertypes "github.com/cosmos/interchain-security/x/ccv/consumer/types" ccv "github.com/cosmos/interchain-security/x/ccv/types" ) diff --git a/tests/e2e/expired_client.go b/tests/e2e/expired_client.go index 79b0a2e955..91af0e77aa 100644 --- a/tests/e2e/expired_client.go +++ b/tests/e2e/expired_client.go @@ -6,9 +6,9 @@ import ( "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/v3/modules/core/02-client/types" - ibcexported "github.com/cosmos/ibc-go/v3/modules/core/exported" - ibctm "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + ibcexported "github.com/cosmos/ibc-go/v4/modules/core/exported" + ibctm "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" ibctesting "github.com/cosmos/interchain-security/legacy_ibc_testing/testing" ccv "github.com/cosmos/interchain-security/x/ccv/types" abci "github.com/tendermint/tendermint/abci/types" diff --git a/tests/e2e/key_assignment.go b/tests/e2e/key_assignment.go index e77eef82e8..2e1bfea7dc 100644 --- a/tests/e2e/key_assignment.go +++ b/tests/e2e/key_assignment.go @@ -3,7 +3,7 @@ package e2e import ( sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/ibc-go/v3/testing/mock" + "github.com/cosmos/ibc-go/v4/testing/mock" providerkeeper "github.com/cosmos/interchain-security/x/ccv/provider/keeper" ccv "github.com/cosmos/interchain-security/x/ccv/types" tmencoding "github.com/tendermint/tendermint/crypto/encoding" diff --git a/tests/e2e/setup.go b/tests/e2e/setup.go index 13b927ae2a..21413f7667 100644 --- a/tests/e2e/setup.go +++ b/tests/e2e/setup.go @@ -4,8 +4,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - ibctmtypes "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" - "github.com/cosmos/ibc-go/v3/testing/mock" + ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" + "github.com/cosmos/ibc-go/v4/testing/mock" e2eutil "github.com/cosmos/interchain-security/testutil/e2e" tmencoding "github.com/tendermint/tendermint/crypto/encoding" @@ -13,8 +13,8 @@ import ( consumertypes "github.com/cosmos/interchain-security/x/ccv/consumer/types" ccv "github.com/cosmos/interchain-security/x/ccv/types" - transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + transfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" ibctesting "github.com/cosmos/interchain-security/legacy_ibc_testing/testing" "github.com/stretchr/testify/suite" diff --git a/tests/e2e/slashing.go b/tests/e2e/slashing.go index e1d7540018..99cd4239e3 100644 --- a/tests/e2e/slashing.go +++ b/tests/e2e/slashing.go @@ -12,8 +12,8 @@ import ( ccv "github.com/cosmos/interchain-security/x/ccv/types" "github.com/cosmos/interchain-security/x/ccv/utils" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" keepertestutil "github.com/cosmos/interchain-security/testutil/keeper" tmtypes "github.com/tendermint/tendermint/types" @@ -213,7 +213,7 @@ func (s *CCVTestSuite) TestSlashPacketAcknowledgement() { err := consumerKeeper.OnAcknowledgementPacket(s.consumerCtx(), packet, channeltypes.NewResultAcknowledgement(ack.Acknowledgement())) s.Require().NoError(err) - err = consumerKeeper.OnAcknowledgementPacket(s.consumerCtx(), packet, channeltypes.NewErrorAcknowledgement("another error")) + err = consumerKeeper.OnAcknowledgementPacket(s.consumerCtx(), packet, channeltypes.NewErrorAcknowledgement(fmt.Errorf("another error"))) s.Require().Error(err) } @@ -288,9 +288,8 @@ func (suite *CCVTestSuite) TestOnRecvSlashPacketErrors() { errAck := providerKeeper.OnRecvSlashPacket(ctx, packet, packetData) suite.Require().False(errAck.Success()) errAckCast := errAck.(channeltypes.Acknowledgement) - suite.Require().Equal( - fmt.Sprintf("cannot find infraction height matching the validator update id 0 for chain %s", - firstBundle.Chain.ChainID), errAckCast.GetError()) + // TODO: see if there's a way to get error reason like before + suite.Require().Equal("ABCI code: 1: error handling packet: see events for details", errAckCast.GetError()) // Restore init chain height providerKeeper.SetInitChainHeight(ctx, consumerChainID, initChainHeight) @@ -300,8 +299,8 @@ func (suite *CCVTestSuite) TestOnRecvSlashPacketErrors() { errAck = providerKeeper.OnRecvSlashPacket(ctx, packet, packetData) suite.Require().False(errAck.Success()) errAckCast = errAck.(channeltypes.Acknowledgement) - suite.Require().Equal( - fmt.Sprintf("invalid infraction type: %s", packetData.Infraction.String()), errAckCast.GetError()) + // TODO: see if there's a way to get error reason like before + suite.Require().Equal("ABCI code: 1: error handling packet: see events for details", errAckCast.GetError()) // save current VSC ID vscID := providerKeeper.GetValidatorSetUpdateId(ctx) @@ -316,9 +315,8 @@ func (suite *CCVTestSuite) TestOnRecvSlashPacketErrors() { errAck = providerKeeper.OnRecvSlashPacket(ctx, packet, packetData) suite.Require().False(errAck.Success()) errAckCast = errAck.(channeltypes.Acknowledgement) - suite.Require().Equal( - fmt.Sprintf("cannot find infraction height matching the validator update id %d for chain %s", - vscID, firstBundle.Chain.ChainID), errAckCast.GetError()) + // TODO: see if there's a way to get error reason like before + suite.Require().Equal("ABCI code: 1: error handling packet: see events for details", errAckCast.GetError()) // construct slashing packet with non existing validator slashingPkt := ccv.NewSlashPacketData( diff --git a/tests/e2e/stop_consumer.go b/tests/e2e/stop_consumer.go index 7354ea362c..1a8e80eac5 100644 --- a/tests/e2e/stop_consumer.go +++ b/tests/e2e/stop_consumer.go @@ -3,7 +3,7 @@ package e2e import ( sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" "github.com/cosmos/interchain-security/x/ccv/provider/types" ccv "github.com/cosmos/interchain-security/x/ccv/types" abci "github.com/tendermint/tendermint/abci/types" diff --git a/tests/e2e/throttle.go b/tests/e2e/throttle.go index cbcbd54338..959e6ea948 100644 --- a/tests/e2e/throttle.go +++ b/tests/e2e/throttle.go @@ -5,7 +5,7 @@ import ( sdktypes "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" icstestingutils "github.com/cosmos/interchain-security/testutil/ibc_testing" providertypes "github.com/cosmos/interchain-security/x/ccv/provider/types" ccvtypes "github.com/cosmos/interchain-security/x/ccv/types" diff --git a/tests/e2e/valset_update.go b/tests/e2e/valset_update.go index d56b5f0f66..2f5e6051cb 100644 --- a/tests/e2e/valset_update.go +++ b/tests/e2e/valset_update.go @@ -5,8 +5,8 @@ import ( cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" ccv "github.com/cosmos/interchain-security/x/ccv/types" abci "github.com/tendermint/tendermint/abci/types" ) diff --git a/tests/integration/actions.go b/tests/integration/actions.go index 71173a580a..eef6fb59fb 100644 --- a/tests/integration/actions.go +++ b/tests/integration/actions.go @@ -11,7 +11,7 @@ import ( "sync" "time" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" consumertypes "github.com/cosmos/interchain-security/x/ccv/consumer/types" "github.com/cosmos/interchain-security/x/ccv/provider/client" diff --git a/tests/integration/state.go b/tests/integration/state.go index 724c157b66..2b3fe95fdb 100644 --- a/tests/integration/state.go +++ b/tests/integration/state.go @@ -8,7 +8,7 @@ import ( "strconv" "time" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" "github.com/tidwall/gjson" "gopkg.in/yaml.v2" ) diff --git a/tests/integration/steps_start_chains.go b/tests/integration/steps_start_chains.go index 0451e7ee16..336160092c 100644 --- a/tests/integration/steps_start_chains.go +++ b/tests/integration/steps_start_chains.go @@ -1,7 +1,7 @@ package main import ( - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" ) func stepStartProviderChain() []Step { diff --git a/testutil/crypto/crypto.go b/testutil/crypto/crypto.go index 4cfba703be..b2b08000ad 100644 --- a/testutil/crypto/crypto.go +++ b/testutil/crypto/crypto.go @@ -3,7 +3,7 @@ package crypto import ( "encoding/binary" - ibcmock "github.com/cosmos/ibc-go/v3/testing/mock" + ibcmock "github.com/cosmos/ibc-go/v4/testing/mock" cryptoEd25519 "crypto/ed25519" diff --git a/testutil/ibc_testing/generic_setup.go b/testutil/ibc_testing/generic_setup.go index a04292558f..2d18675840 100644 --- a/testutil/ibc_testing/generic_setup.go +++ b/testutil/ibc_testing/generic_setup.go @@ -4,7 +4,7 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" ibctesting "github.com/cosmos/interchain-security/legacy_ibc_testing/testing" e2eutil "github.com/cosmos/interchain-security/testutil/e2e" testkeeper "github.com/cosmos/interchain-security/testutil/keeper" diff --git a/testutil/keeper/expectations.go b/testutil/keeper/expectations.go index 02687785c7..7fbed951a9 100644 --- a/testutil/keeper/expectations.go +++ b/testutil/keeper/expectations.go @@ -6,13 +6,13 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - conntypes "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" - ibctmtypes "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + conntypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" "github.com/golang/mock/gomock" - host "github.com/cosmos/ibc-go/v3/modules/core/24-host" + host "github.com/cosmos/ibc-go/v4/modules/core/24-host" ccv "github.com/cosmos/interchain-security/x/ccv/types" extra "github.com/oxyno-zeta/gomock-extra-matcher" diff --git a/testutil/keeper/mocks.go b/testutil/keeper/mocks.go index 38b6cfa57e..e9c9533b10 100644 --- a/testutil/keeper/mocks.go +++ b/testutil/keeper/mocks.go @@ -13,10 +13,10 @@ import ( types1 "github.com/cosmos/cosmos-sdk/x/capability/types" types2 "github.com/cosmos/cosmos-sdk/x/slashing/types" types3 "github.com/cosmos/cosmos-sdk/x/staking/types" - types4 "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - types5 "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types" - types6 "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" - exported "github.com/cosmos/ibc-go/v3/modules/core/exported" + types4 "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + types5 "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types" + types6 "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + exported "github.com/cosmos/ibc-go/v4/modules/core/exported" gomock "github.com/golang/mock/gomock" types7 "github.com/tendermint/tendermint/abci/types" ) diff --git a/testutil/keeper/unit_test_helpers.go b/testutil/keeper/unit_test_helpers.go index 8f430ab91a..7f2267d0a2 100644 --- a/testutil/keeper/unit_test_helpers.go +++ b/testutil/keeper/unit_test_helpers.go @@ -32,7 +32,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" ) // Parameters needed to instantiate an in-memory keeper diff --git a/testutil/simibc/chain_util.go b/testutil/simibc/chain_util.go index 299d54ca58..4f888fe166 100644 --- a/testutil/simibc/chain_util.go +++ b/testutil/simibc/chain_util.go @@ -3,8 +3,8 @@ package simibc import ( "time" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" - ibctmtypes "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" ibctestingcore "github.com/cosmos/interchain-security/legacy_ibc_testing/core" ibctesting "github.com/cosmos/interchain-security/legacy_ibc_testing/testing" abci "github.com/tendermint/tendermint/abci/types" diff --git a/testutil/simibc/ordered_link.go b/testutil/simibc/ordered_link.go index 85beee8f75..a5bf08da92 100644 --- a/testutil/simibc/ordered_link.go +++ b/testutil/simibc/ordered_link.go @@ -1,6 +1,6 @@ package simibc -import channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" +import channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" // Ack represents and ack committed to block state type Ack struct { diff --git a/testutil/simibc/relay_util.go b/testutil/simibc/relay_util.go index a89f9f09b6..80763b78e0 100644 --- a/testutil/simibc/relay_util.go +++ b/testutil/simibc/relay_util.go @@ -3,10 +3,10 @@ package simibc import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" - host "github.com/cosmos/ibc-go/v3/modules/core/24-host" - ibctmtypes "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + host "github.com/cosmos/ibc-go/v4/modules/core/24-host" + ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" simapp "github.com/cosmos/interchain-security/legacy_ibc_testing/simapp" ibctesting "github.com/cosmos/interchain-security/legacy_ibc_testing/testing" "github.com/stretchr/testify/require" diff --git a/testutil/simibc/relayed_path.go b/testutil/simibc/relayed_path.go index 804af4d247..5d7198bc6e 100644 --- a/testutil/simibc/relayed_path.go +++ b/testutil/simibc/relayed_path.go @@ -5,7 +5,7 @@ import ( "testing" - ibctmtypes "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" + ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" ibctesting "github.com/cosmos/interchain-security/legacy_ibc_testing/testing" ) diff --git a/third_party/proto/ibc/core/channel/v1/channel.proto b/third_party/proto/ibc/core/channel/v1/channel.proto index 981ba7e52a..87c4324d3c 100644 --- a/third_party/proto/ibc/core/channel/v1/channel.proto +++ b/third_party/proto/ibc/core/channel/v1/channel.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.channel.v1; -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types"; +option go_package = "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types"; import "gogoproto/gogo.proto"; import "ibc/core/client/v1/client.proto"; diff --git a/third_party/proto/ibc/core/channel/v1/genesis.proto b/third_party/proto/ibc/core/channel/v1/genesis.proto index d95c891b6c..1c0ff6ee88 100644 --- a/third_party/proto/ibc/core/channel/v1/genesis.proto +++ b/third_party/proto/ibc/core/channel/v1/genesis.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.channel.v1; -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types"; +option go_package = "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types"; import "gogoproto/gogo.proto"; import "ibc/core/channel/v1/channel.proto"; diff --git a/third_party/proto/ibc/core/channel/v1/query.proto b/third_party/proto/ibc/core/channel/v1/query.proto index ceb13d0009..986633173c 100644 --- a/third_party/proto/ibc/core/channel/v1/query.proto +++ b/third_party/proto/ibc/core/channel/v1/query.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.channel.v1; -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types"; +option go_package = "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types"; import "ibc/core/client/v1/client.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; diff --git a/third_party/proto/ibc/core/channel/v1/tx.proto b/third_party/proto/ibc/core/channel/v1/tx.proto index c9322c1def..c1ab67a16b 100644 --- a/third_party/proto/ibc/core/channel/v1/tx.proto +++ b/third_party/proto/ibc/core/channel/v1/tx.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.channel.v1; -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types"; +option go_package = "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types"; import "gogoproto/gogo.proto"; import "ibc/core/client/v1/client.proto"; diff --git a/third_party/proto/ibc/core/client/v1/client.proto b/third_party/proto/ibc/core/client/v1/client.proto index 91ad0c97e7..11edeeca87 100644 --- a/third_party/proto/ibc/core/client/v1/client.proto +++ b/third_party/proto/ibc/core/client/v1/client.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.client.v1; -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/02-client/types"; +option go_package = "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; diff --git a/third_party/proto/ibc/core/client/v1/genesis.proto b/third_party/proto/ibc/core/client/v1/genesis.proto index 0ca29d224b..b2930c4841 100644 --- a/third_party/proto/ibc/core/client/v1/genesis.proto +++ b/third_party/proto/ibc/core/client/v1/genesis.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.client.v1; -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/02-client/types"; +option go_package = "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"; import "ibc/core/client/v1/client.proto"; import "gogoproto/gogo.proto"; diff --git a/third_party/proto/ibc/core/client/v1/query.proto b/third_party/proto/ibc/core/client/v1/query.proto index 91a906fe54..b930569313 100644 --- a/third_party/proto/ibc/core/client/v1/query.proto +++ b/third_party/proto/ibc/core/client/v1/query.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.client.v1; -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/02-client/types"; +option go_package = "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"; import "cosmos/base/query/v1beta1/pagination.proto"; import "ibc/core/client/v1/client.proto"; diff --git a/third_party/proto/ibc/core/client/v1/tx.proto b/third_party/proto/ibc/core/client/v1/tx.proto index c96622d215..4c0e981795 100644 --- a/third_party/proto/ibc/core/client/v1/tx.proto +++ b/third_party/proto/ibc/core/client/v1/tx.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.client.v1; -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/02-client/types"; +option go_package = "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; diff --git a/third_party/proto/ibc/core/commitment/v1/commitment.proto b/third_party/proto/ibc/core/commitment/v1/commitment.proto index f0118b7165..1c36fcfbde 100644 --- a/third_party/proto/ibc/core/commitment/v1/commitment.proto +++ b/third_party/proto/ibc/core/commitment/v1/commitment.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.commitment.v1; -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/23-commitment/types"; +option go_package = "github.com/cosmos/ibc-go/v4/modules/core/23-commitment/types"; import "gogoproto/gogo.proto"; import "confio/proofs.proto"; diff --git a/third_party/proto/ibc/core/connection/v1/connection.proto b/third_party/proto/ibc/core/connection/v1/connection.proto index ede143e49a..29e998568d 100644 --- a/third_party/proto/ibc/core/connection/v1/connection.proto +++ b/third_party/proto/ibc/core/connection/v1/connection.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.connection.v1; -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types"; +option go_package = "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types"; import "gogoproto/gogo.proto"; import "ibc/core/commitment/v1/commitment.proto"; diff --git a/third_party/proto/ibc/core/connection/v1/genesis.proto b/third_party/proto/ibc/core/connection/v1/genesis.proto index 1a53422c94..f616ae67e0 100644 --- a/third_party/proto/ibc/core/connection/v1/genesis.proto +++ b/third_party/proto/ibc/core/connection/v1/genesis.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.connection.v1; -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types"; +option go_package = "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types"; import "gogoproto/gogo.proto"; import "ibc/core/connection/v1/connection.proto"; diff --git a/third_party/proto/ibc/core/connection/v1/query.proto b/third_party/proto/ibc/core/connection/v1/query.proto index f28578f5fc..129f30a71a 100644 --- a/third_party/proto/ibc/core/connection/v1/query.proto +++ b/third_party/proto/ibc/core/connection/v1/query.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.connection.v1; -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types"; +option go_package = "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types"; import "gogoproto/gogo.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; diff --git a/third_party/proto/ibc/core/connection/v1/tx.proto b/third_party/proto/ibc/core/connection/v1/tx.proto index e7e09c84cf..1ca0b40400 100644 --- a/third_party/proto/ibc/core/connection/v1/tx.proto +++ b/third_party/proto/ibc/core/connection/v1/tx.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.connection.v1; -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types"; +option go_package = "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types"; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; diff --git a/third_party/proto/ibc/core/types/v1/genesis.proto b/third_party/proto/ibc/core/types/v1/genesis.proto index fbddbf3035..4cc931d32f 100644 --- a/third_party/proto/ibc/core/types/v1/genesis.proto +++ b/third_party/proto/ibc/core/types/v1/genesis.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.types.v1; -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/types"; +option go_package = "github.com/cosmos/ibc-go/v4/modules/core/types"; import "gogoproto/gogo.proto"; import "ibc/core/client/v1/genesis.proto"; diff --git a/third_party/proto/ibc/lightclients/localhost/v1/localhost.proto b/third_party/proto/ibc/lightclients/localhost/v1/localhost.proto index 4305680154..9eda835ebb 100644 --- a/third_party/proto/ibc/lightclients/localhost/v1/localhost.proto +++ b/third_party/proto/ibc/lightclients/localhost/v1/localhost.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.lightclients.localhost.v1; -option go_package = "github.com/cosmos/ibc-go/v3/modules/light-clients/09-localhost/types"; +option go_package = "github.com/cosmos/ibc-go/v4/modules/light-clients/09-localhost/types"; import "gogoproto/gogo.proto"; import "ibc/core/client/v1/client.proto"; diff --git a/third_party/proto/ibc/lightclients/solomachine/v1/solomachine.proto b/third_party/proto/ibc/lightclients/solomachine/v1/solomachine.proto index c279f5e728..37bd81e923 100644 --- a/third_party/proto/ibc/lightclients/solomachine/v1/solomachine.proto +++ b/third_party/proto/ibc/lightclients/solomachine/v1/solomachine.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.lightclients.solomachine.v1; -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/02-client/legacy/v100"; +option go_package = "github.com/cosmos/ibc-go/v4/modules/core/02-client/legacy/v100"; import "ibc/core/connection/v1/connection.proto"; import "ibc/core/channel/v1/channel.proto"; diff --git a/third_party/proto/ibc/lightclients/solomachine/v2/solomachine.proto b/third_party/proto/ibc/lightclients/solomachine/v2/solomachine.proto index e626c18ac6..c735fddddf 100644 --- a/third_party/proto/ibc/lightclients/solomachine/v2/solomachine.proto +++ b/third_party/proto/ibc/lightclients/solomachine/v2/solomachine.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.lightclients.solomachine.v2; -option go_package = "github.com/cosmos/ibc-go/v3/modules/light-clients/06-solomachine/types"; +option go_package = "github.com/cosmos/ibc-go/v4/modules/light-clients/06-solomachine/types"; import "ibc/core/connection/v1/connection.proto"; import "ibc/core/channel/v1/channel.proto"; diff --git a/third_party/proto/ibc/lightclients/tendermint/v1/tendermint.proto b/third_party/proto/ibc/lightclients/tendermint/v1/tendermint.proto index ac39341dbf..7dd925f58d 100644 --- a/third_party/proto/ibc/lightclients/tendermint/v1/tendermint.proto +++ b/third_party/proto/ibc/lightclients/tendermint/v1/tendermint.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.lightclients.tendermint.v1; -option go_package = "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types"; +option go_package = "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types"; import "tendermint/types/validator.proto"; import "tendermint/types/types.proto"; diff --git a/x/ccv/consumer/ibc_module.go b/x/ccv/consumer/ibc_module.go index 59e5382040..80f7a96df7 100644 --- a/x/ccv/consumer/ibc_module.go +++ b/x/ccv/consumer/ibc_module.go @@ -2,18 +2,20 @@ package consumer import ( "fmt" + "strings" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" - porttypes "github.com/cosmos/ibc-go/v3/modules/core/05-port/types" - host "github.com/cosmos/ibc-go/v3/modules/core/24-host" - ibcexported "github.com/cosmos/ibc-go/v3/modules/core/exported" + transfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types" + host "github.com/cosmos/ibc-go/v4/modules/core/24-host" + ibcexported "github.com/cosmos/ibc-go/v4/modules/core/exported" "github.com/cosmos/interchain-security/x/ccv/consumer/keeper" consumertypes "github.com/cosmos/interchain-security/x/ccv/consumer/types" providertypes "github.com/cosmos/interchain-security/x/ccv/provider/types" + "github.com/cosmos/interchain-security/x/ccv/types" ccv "github.com/cosmos/interchain-security/x/ccv/types" ) @@ -28,10 +30,22 @@ func (am AppModule) OnChanOpenInit( chanCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, version string, -) error { +) (string, error) { + + // set to the default version if the provided version is empty according to the ICS26 spec + // https://github.com/cosmos/ibc/blob/main/spec/core/ics-026-routing-module/README.md#technical-specification + if strings.TrimSpace(version) == "" { + version = types.Version + } + + // check that provided version is correct + if version != types.Version { + return "", sdkerrors.Wrapf(types.ErrInvalidVersion, "got %s, expected %s", version, types.Version) + } + // ensure provider channel hasn't already been created if providerChannel, ok := am.keeper.GetProviderChannel(ctx); ok { - return sdkerrors.Wrapf(ccv.ErrDuplicateChannel, + return version, sdkerrors.Wrapf(ccv.ErrDuplicateChannel, "provider channel: %s already set", providerChannel) } @@ -39,12 +53,12 @@ func (am AppModule) OnChanOpenInit( if err := validateCCVChannelParams( ctx, am.keeper, order, portID, version, ); err != nil { - return err + return version, err } // ensure the counterparty port ID matches the expected provider port ID if counterparty.PortId != ccv.ProviderPortID { - return sdkerrors.Wrapf(porttypes.ErrInvalidPort, + return version, sdkerrors.Wrapf(porttypes.ErrInvalidPort, "invalid counterparty port: %s, expected %s", counterparty.PortId, ccv.ProviderPortID) } @@ -52,10 +66,10 @@ func (am AppModule) OnChanOpenInit( if err := am.keeper.ClaimCapability( ctx, chanCap, host.ChannelCapabilityPath(portID, channelID), ); err != nil { - return err + return version, err } - return am.keeper.VerifyProviderChain(ctx, connectionHops) + return version, am.keeper.VerifyProviderChain(ctx, connectionHops) } // validateCCVChannelParams validates a ccv channel @@ -210,7 +224,7 @@ func (am AppModule) OnRecvPacket( data ccv.ValidatorSetChangePacketData ) if err := ccv.ModuleCdc.UnmarshalJSON(packet.GetData(), &data); err != nil { - errAck := channeltypes.NewErrorAcknowledgement("cannot unmarshal CCV packet data") + errAck := channeltypes.NewErrorAcknowledgement(fmt.Errorf("cannot unmarshal CCV packet data")) ack = &errAck } else { ack = am.keeper.OnRecvVSCPacket(ctx, packet, data) diff --git a/x/ccv/consumer/ibc_module_test.go b/x/ccv/consumer/ibc_module_test.go index 67eed2568c..cfa4e61166 100644 --- a/x/ccv/consumer/ibc_module_test.go +++ b/x/ccv/consumer/ibc_module_test.go @@ -5,10 +5,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" - conntypes "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" - host "github.com/cosmos/ibc-go/v3/modules/core/24-host" + transfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" + conntypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + host "github.com/cosmos/ibc-go/v4/modules/core/24-host" testkeeper "github.com/cosmos/interchain-security/testutil/keeper" "github.com/cosmos/interchain-security/x/ccv/consumer" consumerkeeper "github.com/cosmos/interchain-security/x/ccv/consumer/keeper" @@ -55,6 +55,25 @@ func TestOnChanOpenInit(t *testing.T) { ) }, true, }, + { + "should succeed when IBC module version isn't provided", func(keeper *consumerkeeper.Keeper, params *params, mocks testkeeper.MockedKeepers) { + params.version = "" + gomock.InOrder( + mocks.MockScopedKeeper.EXPECT().ClaimCapability( + params.ctx, params.chanCap, host.ChannelCapabilityPath( + params.portID, params.channelID)).Return(nil).Times(1), + mocks.MockConnectionKeeper.EXPECT().GetConnection( + params.ctx, "connectionIDToProvider").Return( + conntypes.ConnectionEnd{ClientId: "clientIDToProvider"}, true).Times(1), + ) + }, true, + }, + { + "invalid non-empty IBC module version", + func(keeper *consumerkeeper.Keeper, params *params, mocks testkeeper.MockedKeepers) { + params.version = "2" + }, false, + }, { "invalid: channel to provider already established", func(keeper *consumerkeeper.Keeper, params *params, mocks testkeeper.MockedKeepers) { @@ -124,7 +143,7 @@ func TestOnChanOpenInit(t *testing.T) { tc.setup(&consumerKeeper, ¶ms, mocks) - err := consumerModule.OnChanOpenInit( + version, err := consumerModule.OnChanOpenInit( params.ctx, params.order, params.connectionHops, @@ -136,6 +155,8 @@ func TestOnChanOpenInit(t *testing.T) { ) if tc.expPass { + // assert correct version + require.Equal(t, ccv.Version, version) require.NoError(t, err) } else { require.Error(t, err) diff --git a/x/ccv/consumer/keeper/distribution.go b/x/ccv/consumer/keeper/distribution.go index b381532c4d..f2a534cd14 100644 --- a/x/ccv/consumer/keeper/distribution.go +++ b/x/ccv/consumer/keeper/distribution.go @@ -7,9 +7,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + transfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" "github.com/cosmos/interchain-security/x/ccv/consumer/types" ccv "github.com/cosmos/interchain-security/x/ccv/types" diff --git a/x/ccv/consumer/keeper/genesis_test.go b/x/ccv/consumer/keeper/genesis_test.go index ef24ecc25a..3460a8617c 100644 --- a/x/ccv/consumer/keeper/genesis_test.go +++ b/x/ccv/consumer/keeper/genesis_test.go @@ -6,9 +6,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - commitmenttypes "github.com/cosmos/ibc-go/v3/modules/core/23-commitment/types" - ibctmtypes "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + commitmenttypes "github.com/cosmos/ibc-go/v4/modules/core/23-commitment/types" + ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" testkeeper "github.com/cosmos/interchain-security/testutil/keeper" consumerkeeper "github.com/cosmos/interchain-security/x/ccv/consumer/keeper" ccv "github.com/cosmos/interchain-security/x/ccv/types" diff --git a/x/ccv/consumer/keeper/keeper.go b/x/ccv/consumer/keeper/keeper.go index ee68020966..95f72689e0 100644 --- a/x/ccv/consumer/keeper/keeper.go +++ b/x/ccv/consumer/keeper/keeper.go @@ -10,10 +10,10 @@ import ( capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - conntypes "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" - host "github.com/cosmos/ibc-go/v3/modules/core/24-host" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + conntypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + host "github.com/cosmos/ibc-go/v4/modules/core/24-host" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/interchain-security/x/ccv/consumer/types" diff --git a/x/ccv/consumer/keeper/keeper_test.go b/x/ccv/consumer/keeper/keeper_test.go index b7a9343dd6..b544b3b3ed 100644 --- a/x/ccv/consumer/keeper/keeper_test.go +++ b/x/ccv/consumer/keeper/keeper_test.go @@ -9,7 +9,7 @@ import ( "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/v3/modules/core/03-connection/types" + conntypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types" testkeeper "github.com/cosmos/interchain-security/testutil/keeper" "github.com/cosmos/interchain-security/x/ccv/consumer/types" ccv "github.com/cosmos/interchain-security/x/ccv/types" diff --git a/x/ccv/consumer/keeper/relay.go b/x/ccv/consumer/keeper/relay.go index a26e133ab5..a86ef654e3 100644 --- a/x/ccv/consumer/keeper/relay.go +++ b/x/ccv/consumer/keeper/relay.go @@ -7,9 +7,9 @@ import ( 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/v3/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" - "github.com/cosmos/ibc-go/v3/modules/core/exported" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + "github.com/cosmos/ibc-go/v4/modules/core/exported" "github.com/cosmos/interchain-security/x/ccv/consumer/types" ccv "github.com/cosmos/interchain-security/x/ccv/types" utils "github.com/cosmos/interchain-security/x/ccv/utils" diff --git a/x/ccv/consumer/keeper/relay_test.go b/x/ccv/consumer/keeper/relay_test.go index 86b46e37f7..99e11c1c17 100644 --- a/x/ccv/consumer/keeper/relay_test.go +++ b/x/ccv/consumer/keeper/relay_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + "fmt" "sort" "testing" "time" @@ -9,9 +10,9 @@ import ( "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/v3/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" - host "github.com/cosmos/ibc-go/v3/modules/core/24-host" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + host "github.com/cosmos/ibc-go/v4/modules/core/24-host" testkeeper "github.com/cosmos/interchain-security/testutil/keeper" consumertypes "github.com/cosmos/interchain-security/x/ccv/consumer/types" "github.com/cosmos/interchain-security/x/ccv/types" @@ -222,7 +223,7 @@ func TestOnAcknowledgementPacket(t *testing.T) { ).Return(nil).Times(1), ) - ack = channeltypes.NewErrorAcknowledgement("error") + ack = channeltypes.NewErrorAcknowledgement(fmt.Errorf("error")) err = consumerKeeper.OnAcknowledgementPacket(ctx, packet, ack) require.Nil(t, err) } diff --git a/x/ccv/consumer/module.go b/x/ccv/consumer/module.go index 847404a958..68a2d60c1c 100644 --- a/x/ccv/consumer/module.go +++ b/x/ccv/consumer/module.go @@ -17,8 +17,7 @@ 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/v3/modules/core/05-port/types" + porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types" "github.com/cosmos/interchain-security/x/ccv/consumer/client/cli" "github.com/cosmos/interchain-security/x/ccv/consumer/keeper" diff --git a/x/ccv/consumer/types/genesis.go b/x/ccv/consumer/types/genesis.go index e94984b3f0..2910f929ff 100644 --- a/x/ccv/consumer/types/genesis.go +++ b/x/ccv/consumer/types/genesis.go @@ -2,7 +2,7 @@ package types import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - ibctmtypes "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" + ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" ccv "github.com/cosmos/interchain-security/x/ccv/types" abci "github.com/tendermint/tendermint/abci/types" diff --git a/x/ccv/consumer/types/genesis.pb.go b/x/ccv/consumer/types/genesis.pb.go index c72bf936b8..d55baa92ad 100644 --- a/x/ccv/consumer/types/genesis.pb.go +++ b/x/ccv/consumer/types/genesis.pb.go @@ -5,8 +5,8 @@ package types import ( fmt "fmt" - _ "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" - types "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" + _ "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + types "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" types2 "github.com/cosmos/interchain-security/x/ccv/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" diff --git a/x/ccv/consumer/types/genesis_test.go b/x/ccv/consumer/types/genesis_test.go index eb69c8cf70..a0046a5387 100644 --- a/x/ccv/consumer/types/genesis_test.go +++ b/x/ccv/consumer/types/genesis_test.go @@ -7,9 +7,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - commitmenttypes "github.com/cosmos/ibc-go/v3/modules/core/23-commitment/types" - ibctmtypes "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + commitmenttypes "github.com/cosmos/ibc-go/v4/modules/core/23-commitment/types" + ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" abci "github.com/tendermint/tendermint/abci/types" "github.com/cosmos/interchain-security/x/ccv/consumer/types" diff --git a/x/ccv/provider/client/proposal_handler.go b/x/ccv/provider/client/proposal_handler.go index bfccec5c8b..2feb155178 100644 --- a/x/ccv/provider/client/proposal_handler.go +++ b/x/ccv/provider/client/proposal_handler.go @@ -15,7 +15,7 @@ import ( govclient "github.com/cosmos/cosmos-sdk/x/gov/client" govrest "github.com/cosmos/cosmos-sdk/x/gov/client/rest" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" "github.com/cosmos/interchain-security/x/ccv/provider/types" "github.com/spf13/cobra" ) diff --git a/x/ccv/provider/ibc_module.go b/x/ccv/provider/ibc_module.go index 6f0b2ebd8d..5261ef7572 100644 --- a/x/ccv/provider/ibc_module.go +++ b/x/ccv/provider/ibc_module.go @@ -6,10 +6,10 @@ import ( 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/v3/modules/core/04-channel/types" - porttypes "github.com/cosmos/ibc-go/v3/modules/core/05-port/types" - host "github.com/cosmos/ibc-go/v3/modules/core/24-host" - ibcexported "github.com/cosmos/ibc-go/v3/modules/core/exported" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types" + host "github.com/cosmos/ibc-go/v4/modules/core/24-host" + ibcexported "github.com/cosmos/ibc-go/v4/modules/core/exported" "github.com/cosmos/interchain-security/x/ccv/provider/keeper" providertypes "github.com/cosmos/interchain-security/x/ccv/provider/types" ccv "github.com/cosmos/interchain-security/x/ccv/types" @@ -25,11 +25,12 @@ func (am AppModule) OnChanOpenInit( connectionHops []string, portID string, channelID string, - chanCap *capabilitytypes.Capability, + channelCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, version string, -) error { - return sdkerrors.Wrap(ccv.ErrInvalidChannelFlow, "channel handshake must be initiated by consumer chain") +) (string, error) { + + return version, sdkerrors.Wrap(ccv.ErrInvalidChannelFlow, "channel handshake must be initiated by consumer chain") } // OnChanOpenTry implements the IBCModule interface @@ -178,7 +179,7 @@ func (am AppModule) OnRecvPacket( ) // unmarshall consumer packet if err := ccv.ModuleCdc.UnmarshalJSON(packet.GetData(), &consumerPacket); err != nil { - errAck := channeltypes.NewErrorAcknowledgement("cannot unmarshal CCV packet data") + errAck := channeltypes.NewErrorAcknowledgement(fmt.Errorf("cannot unmarshal CCV packet data")) ack = &errAck } else { // TODO: call ValidateBasic method on consumer packet data @@ -192,7 +193,7 @@ func (am AppModule) OnRecvPacket( // handle SlashPacket ack = am.keeper.OnRecvSlashPacket(ctx, packet, *consumerPacket.GetSlashPacketData()) default: - errAck := channeltypes.NewErrorAcknowledgement(fmt.Sprintf("invalid consumer packet type: %q", consumerPacket.Type)) + errAck := channeltypes.NewErrorAcknowledgement(fmt.Errorf("invalid consumer packet type: %q", consumerPacket.Type)) ack = &errAck } } diff --git a/x/ccv/provider/ibc_module_test.go b/x/ccv/provider/ibc_module_test.go index c2ebbe636f..ab41a7b530 100644 --- a/x/ccv/provider/ibc_module_test.go +++ b/x/ccv/provider/ibc_module_test.go @@ -6,10 +6,10 @@ import ( 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" - conntypes "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" - host "github.com/cosmos/ibc-go/v3/modules/core/24-host" - ibctmtypes "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" + conntypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + host "github.com/cosmos/ibc-go/v4/modules/core/24-host" + ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" testkeeper "github.com/cosmos/interchain-security/testutil/keeper" "github.com/cosmos/interchain-security/x/ccv/provider" providerkeeper "github.com/cosmos/interchain-security/x/ccv/provider/keeper" @@ -31,7 +31,7 @@ func TestOnChanOpenInit(t *testing.T) { providerModule := provider.NewAppModule(&providerKeeper) // OnChanOpenInit must error for provider even with correct arguments - err := providerModule.OnChanOpenInit( + _, err := providerModule.OnChanOpenInit( ctx, channeltypes.ORDERED, []string{"connection-1"}, diff --git a/x/ccv/provider/keeper/genesis_test.go b/x/ccv/provider/keeper/genesis_test.go index 6b79bbd6df..eceb31e965 100644 --- a/x/ccv/provider/keeper/genesis_test.go +++ b/x/ccv/provider/keeper/genesis_test.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" - host "github.com/cosmos/ibc-go/v3/modules/core/24-host" + host "github.com/cosmos/ibc-go/v4/modules/core/24-host" testkeeper "github.com/cosmos/interchain-security/testutil/keeper" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 6c94a5bf5a..ef2c4d289d 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -11,12 +11,12 @@ import ( capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - conntypes "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" - host "github.com/cosmos/ibc-go/v3/modules/core/24-host" - ibcexported "github.com/cosmos/ibc-go/v3/modules/core/exported" - ibctmtypes "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + conntypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + host "github.com/cosmos/ibc-go/v4/modules/core/24-host" + ibcexported "github.com/cosmos/ibc-go/v4/modules/core/exported" + ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" consumertypes "github.com/cosmos/interchain-security/x/ccv/consumer/types" "github.com/cosmos/interchain-security/x/ccv/provider/types" diff --git a/x/ccv/provider/keeper/params.go b/x/ccv/provider/keeper/params.go index 4db4f53bb9..8484dd2426 100644 --- a/x/ccv/provider/keeper/params.go +++ b/x/ccv/provider/keeper/params.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - ibctmtypes "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" + ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" "github.com/cosmos/interchain-security/x/ccv/provider/types" ccvtypes "github.com/cosmos/interchain-security/x/ccv/types" diff --git a/x/ccv/provider/keeper/params_test.go b/x/ccv/provider/keeper/params_test.go index d82158cb57..d67c85d586 100644 --- a/x/ccv/provider/keeper/params_test.go +++ b/x/ccv/provider/keeper/params_test.go @@ -4,9 +4,9 @@ import ( "testing" "time" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - commitmenttypes "github.com/cosmos/ibc-go/v3/modules/core/23-commitment/types" - ibctmtypes "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + commitmenttypes "github.com/cosmos/ibc-go/v4/modules/core/23-commitment/types" + ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" testkeeper "github.com/cosmos/interchain-security/testutil/keeper" providertypes "github.com/cosmos/interchain-security/x/ccv/provider/types" "github.com/stretchr/testify/require" diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index 17e5ec888a..ff8091c575 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -5,14 +5,14 @@ import ( "strconv" "time" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/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/v3/modules/core/02-client/types" - commitmenttypes "github.com/cosmos/ibc-go/v3/modules/core/23-commitment/types" - ibctmtypes "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + commitmenttypes "github.com/cosmos/ibc-go/v4/modules/core/23-commitment/types" + ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" "github.com/cosmos/interchain-security/x/ccv/provider/types" ccv "github.com/cosmos/interchain-security/x/ccv/types" abci "github.com/tendermint/tendermint/abci/types" diff --git a/x/ccv/provider/keeper/proposal_test.go b/x/ccv/provider/keeper/proposal_test.go index 5c5adee38f..fb87d562af 100644 --- a/x/ccv/provider/keeper/proposal_test.go +++ b/x/ccv/provider/keeper/proposal_test.go @@ -9,8 +9,8 @@ import ( _go "github.com/confio/ics23/go" sdk "github.com/cosmos/cosmos-sdk/types" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - ibctmtypes "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" "github.com/golang/mock/gomock" abci "github.com/tendermint/tendermint/abci/types" diff --git a/x/ccv/provider/keeper/relay.go b/x/ccv/provider/keeper/relay.go index 36801ac4fc..b980c3c0a3 100644 --- a/x/ccv/provider/keeper/relay.go +++ b/x/ccv/provider/keeper/relay.go @@ -9,9 +9,9 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" - "github.com/cosmos/ibc-go/v3/modules/core/exported" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + "github.com/cosmos/ibc-go/v4/modules/core/exported" providertypes "github.com/cosmos/interchain-security/x/ccv/provider/types" ccv "github.com/cosmos/interchain-security/x/ccv/types" utils "github.com/cosmos/interchain-security/x/ccv/utils" @@ -36,7 +36,7 @@ func (k Keeper) OnRecvVSCMaturedPacket( } if err := k.QueueThrottledVSCMaturedPacketData(ctx, chainID, packet.Sequence, data); err != nil { - return channeltypes.NewErrorAcknowledgement(fmt.Sprintf( + return channeltypes.NewErrorAcknowledgement(fmt.Errorf( "failed to queue VSCMatured packet data: %s", err.Error())) } @@ -309,7 +309,7 @@ func (k Keeper) OnRecvSlashPacket(ctx sdk.Context, packet channeltypes.Packet, d "vscID", data.ValsetUpdateId, "infractionType", data.Infraction, ) - return channeltypes.NewErrorAcknowledgement(err.Error()) + return channeltypes.NewErrorAcknowledgement(err) } // The slash packet validator address may be known only on the consumer chain, @@ -331,7 +331,7 @@ func (k Keeper) OnRecvSlashPacket(ctx sdk.Context, packet channeltypes.Packet, d // Queue slash packet data in the same (consumer chain specific) queue as vsc matured packet data, // to enforce order of handling between the two packet data types. if err := k.QueueThrottledSlashPacketData(ctx, chainID, packet.Sequence, data); err != nil { - return channeltypes.NewErrorAcknowledgement(fmt.Sprintf("failed to queue slash packet data: %s", err.Error())) + return channeltypes.NewErrorAcknowledgement(fmt.Errorf("failed to queue slash packet data: %s", err.Error())) } k.Logger(ctx).Info("slash packet received and enqueued", diff --git a/x/ccv/provider/keeper/relay_test.go b/x/ccv/provider/keeper/relay_test.go index 547834e208..c2996a5efc 100644 --- a/x/ccv/provider/keeper/relay_test.go +++ b/x/ccv/provider/keeper/relay_test.go @@ -5,9 +5,9 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" - exported "github.com/cosmos/ibc-go/v3/modules/core/exported" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + exported "github.com/cosmos/ibc-go/v4/modules/core/exported" "github.com/cosmos/interchain-security/x/ccv/provider/keeper" providertypes "github.com/cosmos/interchain-security/x/ccv/provider/types" "github.com/golang/mock/gomock" diff --git a/x/ccv/provider/module.go b/x/ccv/provider/module.go index dc8cf69ef8..cba9af2ae7 100644 --- a/x/ccv/provider/module.go +++ b/x/ccv/provider/module.go @@ -12,15 +12,14 @@ 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/v4/modules/core/05-port/types" + "github.com/cosmos/interchain-security/x/ccv/provider/client/cli" + "github.com/cosmos/interchain-security/x/ccv/provider/keeper" + providertypes "github.com/cosmos/interchain-security/x/ccv/provider/types" "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" abci "github.com/tendermint/tendermint/abci/types" - - porttypes "github.com/cosmos/ibc-go/v3/modules/core/05-port/types" - "github.com/cosmos/interchain-security/x/ccv/provider/client/cli" - "github.com/cosmos/interchain-security/x/ccv/provider/keeper" - providertypes "github.com/cosmos/interchain-security/x/ccv/provider/types" ) var ( diff --git a/x/ccv/provider/module_test.go b/x/ccv/provider/module_test.go index 291fa09022..9f8e78a4b7 100644 --- a/x/ccv/provider/module_test.go +++ b/x/ccv/provider/module_test.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - host "github.com/cosmos/ibc-go/v3/modules/core/24-host" + host "github.com/cosmos/ibc-go/v4/modules/core/24-host" testkeeper "github.com/cosmos/interchain-security/testutil/keeper" "github.com/cosmos/interchain-security/x/ccv/provider" "github.com/cosmos/interchain-security/x/ccv/provider/types" diff --git a/x/ccv/provider/proposal_handler_test.go b/x/ccv/provider/proposal_handler_test.go index 7e766fea1b..30a2224ee1 100644 --- a/x/ccv/provider/proposal_handler_test.go +++ b/x/ccv/provider/proposal_handler_test.go @@ -6,7 +6,7 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" "testing" "time" diff --git a/x/ccv/provider/types/genesis.go b/x/ccv/provider/types/genesis.go index 06c1263901..0098076818 100644 --- a/x/ccv/provider/types/genesis.go +++ b/x/ccv/provider/types/genesis.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - host "github.com/cosmos/ibc-go/v3/modules/core/24-host" + host "github.com/cosmos/ibc-go/v4/modules/core/24-host" ccv "github.com/cosmos/interchain-security/x/ccv/types" ) diff --git a/x/ccv/provider/types/genesis_test.go b/x/ccv/provider/types/genesis_test.go index 709a08d41e..e64eb4d4a2 100644 --- a/x/ccv/provider/types/genesis_test.go +++ b/x/ccv/provider/types/genesis_test.go @@ -4,9 +4,9 @@ import ( "testing" "time" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - commitmenttypes "github.com/cosmos/ibc-go/v3/modules/core/23-commitment/types" - ibctmtypes "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + commitmenttypes "github.com/cosmos/ibc-go/v4/modules/core/23-commitment/types" + ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" testutil "github.com/cosmos/interchain-security/testutil/keeper" consumertypes "github.com/cosmos/interchain-security/x/ccv/consumer/types" "github.com/cosmos/interchain-security/x/ccv/provider/types" diff --git a/x/ccv/provider/types/params.go b/x/ccv/provider/types/params.go index 8ec1e4fd3c..eb7e47ba1d 100644 --- a/x/ccv/provider/types/params.go +++ b/x/ccv/provider/types/params.go @@ -5,9 +5,9 @@ import ( "time" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - commitmenttypes "github.com/cosmos/ibc-go/v3/modules/core/23-commitment/types" - ibctmtypes "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + commitmenttypes "github.com/cosmos/ibc-go/v4/modules/core/23-commitment/types" + ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" consumertypes "github.com/cosmos/interchain-security/x/ccv/consumer/types" ccvtypes "github.com/cosmos/interchain-security/x/ccv/types" ) diff --git a/x/ccv/provider/types/params_test.go b/x/ccv/provider/types/params_test.go index b383f17edf..acee7abe11 100644 --- a/x/ccv/provider/types/params_test.go +++ b/x/ccv/provider/types/params_test.go @@ -4,9 +4,9 @@ import ( "testing" "time" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - commitmenttypes "github.com/cosmos/ibc-go/v3/modules/core/23-commitment/types" - ibctmtypes "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + commitmenttypes "github.com/cosmos/ibc-go/v4/modules/core/23-commitment/types" + ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" "github.com/stretchr/testify/require" "github.com/cosmos/interchain-security/x/ccv/provider/types" diff --git a/x/ccv/provider/types/proposal.go b/x/ccv/provider/types/proposal.go index 9b7b928b51..c31bb23b72 100644 --- a/x/ccv/provider/types/proposal.go +++ b/x/ccv/provider/types/proposal.go @@ -7,7 +7,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" ccvtypes "github.com/cosmos/interchain-security/x/ccv/types" ) diff --git a/x/ccv/provider/types/proposal_test.go b/x/ccv/provider/types/proposal_test.go index 9ec0f9fd7f..edca61d814 100644 --- a/x/ccv/provider/types/proposal_test.go +++ b/x/ccv/provider/types/proposal_test.go @@ -12,8 +12,8 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - ibctmtypes "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" "github.com/cosmos/interchain-security/x/ccv/provider/types" ) diff --git a/x/ccv/provider/types/provider.pb.go b/x/ccv/provider/types/provider.pb.go index b89bf21a76..8dc156c012 100644 --- a/x/ccv/provider/types/provider.pb.go +++ b/x/ccv/provider/types/provider.pb.go @@ -5,8 +5,8 @@ package types import ( fmt "fmt" - types "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - types1 "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" + types "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + types1 "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" diff --git a/x/ccv/types/expected_keepers.go b/x/ccv/types/expected_keepers.go index 9db2c1ec88..af88f00f00 100644 --- a/x/ccv/types/expected_keepers.go +++ b/x/ccv/types/expected_keepers.go @@ -9,10 +9,10 @@ import ( capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/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/v3/modules/core/02-client/types" - conntypes "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" - ibcexported "github.com/cosmos/ibc-go/v3/modules/core/exported" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + conntypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + ibcexported "github.com/cosmos/ibc-go/v4/modules/core/exported" abci "github.com/tendermint/tendermint/abci/types" ) diff --git a/x/ccv/types/shared_params.go b/x/ccv/types/shared_params.go index fca7856794..95ef5e850f 100644 --- a/x/ccv/types/shared_params.go +++ b/x/ccv/types/shared_params.go @@ -5,7 +5,7 @@ import ( "time" sdktypes "github.com/cosmos/cosmos-sdk/types" - ibchost "github.com/cosmos/ibc-go/v3/modules/core/24-host" + ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host" ) const ( diff --git a/x/ccv/utils/utils.go b/x/ccv/utils/utils.go index 98b841f2b6..261f5af39e 100644 --- a/x/ccv/utils/utils.go +++ b/x/ccv/utils/utils.go @@ -7,9 +7,9 @@ import ( cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" - host "github.com/cosmos/ibc-go/v3/modules/core/24-host" + clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + host "github.com/cosmos/ibc-go/v4/modules/core/24-host" ccv "github.com/cosmos/interchain-security/x/ccv/types" abci "github.com/tendermint/tendermint/abci/types" tmprotocrypto "github.com/tendermint/tendermint/proto/tendermint/crypto"