Skip to content

Commit

Permalink
chore: remove legacy_ibc_testing (rebased on main) (#1185)
Browse files Browse the repository at this point in the history
* chore: remove legacy_ibc_testing

* fix import

* introduce provider.UnmarshalConsumerPacketData

* use patched ibc-go

* fix annoying import order

* test: ignore key ordering

Seems like ibctesting.GenerateKeys can returns keys in different orders
when test cover is enabled.

* fix after rebase

* replace allinbits/ibc-go with patched cosmos/ibc-go

Also fix panic in TestRedelegationNoConsumer

* fix lint

* use released ibc-go 7.3.0

* add newPacketFromConsumer/Provider helper funcs

* constructPacket method return ccv type instead of []byte
  • Loading branch information
tbruyelle committed Sep 7, 2023
1 parent 27e7368 commit 4f9d35a
Show file tree
Hide file tree
Showing 41 changed files with 490 additions and 2,548 deletions.
6 changes: 3 additions & 3 deletions app/consumer-democracy/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import (
ibchost "github.com/cosmos/ibc-go/v7/modules/core/exported"
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
tendermint "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint"
ibctesting "github.com/cosmos/ibc-go/v7/testing"
ibctestingtypes "github.com/cosmos/ibc-go/v7/testing/types"
"github.com/spf13/cast"

autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
Expand Down Expand Up @@ -103,8 +105,6 @@ import (
tmos "github.com/cometbft/cometbft/libs/os"

appparams "github.com/cosmos/interchain-security/v3/app/params"
ibctestingcore "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/core"
ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing"
testutil "github.com/cosmos/interchain-security/v3/testutil/integration"
consumer "github.com/cosmos/interchain-security/v3/x/ccv/consumer"
consumerkeeper "github.com/cosmos/interchain-security/v3/x/ccv/consumer/keeper"
Expand Down Expand Up @@ -916,7 +916,7 @@ func (app *App) GetBaseApp() *baseapp.BaseApp {
}

// GetStakingKeeper implements the TestingApp interface.
func (app *App) GetStakingKeeper() ibctestingcore.StakingKeeper {
func (app *App) GetStakingKeeper() ibctestingtypes.StakingKeeper {
return app.ConsumerKeeper
}

Expand Down
8 changes: 5 additions & 3 deletions app/consumer-democracy/proposals_whitelisting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ package app_test
import (
"testing"

ibctesting "github.com/cosmos/ibc-go/v7/testing"
"github.com/stretchr/testify/require"

appConsumer "github.com/cosmos/interchain-security/v3/app/consumer-democracy"
ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing"
icstestingutils "github.com/cosmos/interchain-security/v3/testutil/ibc_testing"
testutil "github.com/cosmos/interchain-security/v3/testutil/integration"
)

func TestDemocracyGovernanceWhitelistingKeys(t *testing.T) {
chain := ibctesting.NewTestChain(t, ibctesting.NewCoordinator(t, 0),
icstestingutils.DemocracyConsumerAppIniter, "test")
_, valUpdates, _ := testutil.CreateValidators(t, 4)
ibctesting.DefaultTestingAppInit = icstestingutils.DemocracyConsumerAppIniter(valUpdates)
chain := ibctesting.NewTestChain(t, ibctesting.NewCoordinator(t, 0), "test")
paramKeeper := chain.App.(*appConsumer.App).ParamsKeeper
for paramKey := range appConsumer.LegacyWhitelistedParams {
ss, ok := paramKeeper.GetSubspace(paramKey.Subspace)
Expand Down
6 changes: 3 additions & 3 deletions app/consumer/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import (
ibchost "github.com/cosmos/ibc-go/v7/modules/core/exported"
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
tendermint "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint"
ibctesting "github.com/cosmos/ibc-go/v7/testing"
ibctestingtypes "github.com/cosmos/ibc-go/v7/testing/types"
"github.com/spf13/cast"

autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
Expand Down Expand Up @@ -86,8 +88,6 @@ import (
tmos "github.com/cometbft/cometbft/libs/os"

appparams "github.com/cosmos/interchain-security/v3/app/params"
ibctestingcore "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/core"
ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing"
testutil "github.com/cosmos/interchain-security/v3/testutil/integration"
ibcconsumer "github.com/cosmos/interchain-security/v3/x/ccv/consumer"
ibcconsumerkeeper "github.com/cosmos/interchain-security/v3/x/ccv/consumer/keeper"
Expand Down Expand Up @@ -732,7 +732,7 @@ func (app *App) GetBaseApp() *baseapp.BaseApp {
}

// GetStakingKeeper implements the TestingApp interface.
func (app *App) GetStakingKeeper() ibctestingcore.StakingKeeper {
func (app *App) GetStakingKeeper() ibctestingtypes.StakingKeeper {
return app.ConsumerKeeper
}

Expand Down
6 changes: 3 additions & 3 deletions app/provider/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import (
ibchost "github.com/cosmos/ibc-go/v7/modules/core/exported"
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
tendermint "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint"
ibctesting "github.com/cosmos/ibc-go/v7/testing"
ibctestingtypes "github.com/cosmos/ibc-go/v7/testing/types"
"github.com/spf13/cast"

autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
Expand Down Expand Up @@ -99,8 +101,6 @@ import (
tmos "github.com/cometbft/cometbft/libs/os"

appparams "github.com/cosmos/interchain-security/v3/app/params"
ibctestingcore "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/core"
ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing"
testutil "github.com/cosmos/interchain-security/v3/testutil/integration"
ibcprovider "github.com/cosmos/interchain-security/v3/x/ccv/provider"
ibcproviderclient "github.com/cosmos/interchain-security/v3/x/ccv/provider/client"
Expand Down Expand Up @@ -817,7 +817,7 @@ func (app *App) GetBaseApp() *baseapp.BaseApp {
}

// GetStakingKeeper implements the TestingApp interface.
func (app *App) GetStakingKeeper() ibctestingcore.StakingKeeper {
func (app *App) GetStakingKeeper() ibctestingtypes.StakingKeeper {
return app.StakingKeeper
}

Expand Down
6 changes: 3 additions & 3 deletions app/sovereign/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import (
ibchost "github.com/cosmos/ibc-go/v7/modules/core/exported"
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
tendermint "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint"
ibctesting "github.com/cosmos/ibc-go/v7/testing"
ibctestingtypes "github.com/cosmos/ibc-go/v7/testing/types"
"github.com/spf13/cast"

autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
Expand Down Expand Up @@ -104,8 +106,6 @@ import (
tmos "github.com/cometbft/cometbft/libs/os"

appparams "github.com/cosmos/interchain-security/v3/app/params"
ibctestingcore "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/core"
ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing"
testutil "github.com/cosmos/interchain-security/v3/testutil/integration"
)

Expand Down Expand Up @@ -770,7 +770,7 @@ func (app *App) GetBaseApp() *baseapp.BaseApp {
}

// GetStakingKeeper implements the TestingApp interface.
func (app *App) GetStakingKeeper() ibctestingcore.StakingKeeper {
func (app *App) GetStakingKeeper() ibctestingtypes.StakingKeeper {
return app.StakingKeeper
}

Expand Down
13 changes: 0 additions & 13 deletions legacy_ibc_testing/README.md

This file was deleted.

48 changes: 0 additions & 48 deletions legacy_ibc_testing/core/events.go

This file was deleted.

20 changes: 0 additions & 20 deletions legacy_ibc_testing/core/expected_keepers.go

This file was deleted.

85 changes: 0 additions & 85 deletions legacy_ibc_testing/simapp/helpers/test_helpers.go

This file was deleted.

Loading

0 comments on commit 4f9d35a

Please sign in to comment.