Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump ibctest version and ibc-go version to v6 for e2e module #2479

Merged
merged 7 commits into from
Oct 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions e2e/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ go 1.18
replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1

require (
github.com/cosmos/cosmos-sdk v0.46.0
github.com/cosmos/ibc-go/v5 v5.0.0-beta1
github.com/cosmos/cosmos-sdk v0.46.1
github.com/cosmos/ibc-go/v6 v6.0.0-alpha1
github.com/cosmos/interchain-accounts v0.3.1-0.20220816085955-393d8444c111
github.com/docker/docker v20.10.17+incompatible
github.com/strangelove-ventures/ibctest v0.0.0-20220824180329-f73a9f936fce
github.com/strangelove-ventures/ibctest/v6 v6.0.0-20221005154709-b642157674bc
github.com/stretchr/testify v1.8.0
github.com/tendermint/tendermint v0.34.20
github.com/tendermint/tendermint v0.34.21
go.uber.org/zap v1.21.0
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4
google.golang.org/grpc v1.48.0
google.golang.org/grpc v1.49.0
)

require (
Expand All @@ -23,7 +23,7 @@ require (
cloud.google.com/go/iam v0.3.0 // indirect
cloud.google.com/go/storage v1.14.0 // indirect
cosmossdk.io/errors v1.0.0-beta.7 // indirect
cosmossdk.io/math v1.0.0-beta.2 // indirect
cosmossdk.io/math v1.0.0-beta.3 // indirect
filippo.io/edwards25519 v1.0.0-rc.1 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.1 // indirect
Expand Down Expand Up @@ -170,6 +170,7 @@ require (
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/net v0.0.0-20220726230323-06994584191e // indirect
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
Expand All @@ -186,7 +187,6 @@ require (
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.3.0 // indirect
lukechampine.com/blake3 v1.1.6 // indirect
lukechampine.com/uint128 v1.1.1 // indirect
modernc.org/cc/v3 v3.36.0 // indirect
Expand Down
718 changes: 21 additions & 697 deletions e2e/go.sum

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions e2e/testconfig/testconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
"github.com/strangelove-ventures/ibctest/ibc"
"github.com/strangelove-ventures/ibctest/v6/ibc"
tmjson "github.com/tendermint/tendermint/libs/json"
tmtypes "github.com/tendermint/tendermint/types"

Expand Down Expand Up @@ -159,14 +159,14 @@ func newDefaultSimappConfig(cc ChainConfig, name, chainID, denom string) ibc.Cha
GasAdjustment: 1.3,
TrustingPeriod: "508h",
NoHostMount: false,
ModifyGenesis: defaultModifyGenesis(denom),
ModifyGenesis: defaultModifyGenesis(),
}
}

// defaultModifyGenesis will only modify governance params to ensure the voting period and minimum deposit
// are functional for e2e testing purposes.
func defaultModifyGenesis(denom string) func([]byte) ([]byte, error) {
return func(genbz []byte) ([]byte, error) {
func defaultModifyGenesis() func(ibc.ChainConfig, []byte) ([]byte, error) {
return func(chainConfig ibc.ChainConfig, genbz []byte) ([]byte, error) {
genDoc, err := tmtypes.GenesisDocFromJSON(genbz)
if err != nil {
return nil, fmt.Errorf("failed to unmarshal genesis bytes into genesis doc: %w", err)
Expand All @@ -187,7 +187,7 @@ func defaultModifyGenesis(denom string) func([]byte) ([]byte, error) {
}

// set correct minimum deposit using configured denom
govGenesisState.DepositParams.MinDeposit = sdk.NewCoins(sdk.NewCoin(denom, govv1beta1.DefaultMinDepositTokens))
govGenesisState.DepositParams.MinDeposit = sdk.NewCoins(sdk.NewCoin(chainConfig.Denom, govv1beta1.DefaultMinDepositTokens))
govGenesisState.VotingParams.VotingPeriod = testvalues.VotingPeriod

govGenBz, err := cdc.MarshalJSON(govGenesisState)
Expand Down
10 changes: 5 additions & 5 deletions e2e/tests/core/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import (
"testing"
"time"

"github.com/strangelove-ventures/ibctest/ibc"
"github.com/strangelove-ventures/ibctest/test"
"github.com/strangelove-ventures/ibctest/v6/ibc"
"github.com/strangelove-ventures/ibctest/v6/test"
"github.com/stretchr/testify/suite"

"github.com/cosmos/ibc-go/e2e/testsuite"
"github.com/cosmos/ibc-go/e2e/testvalues"
clienttypes "github.com/cosmos/ibc-go/v5/modules/core/02-client/types"
ibcexported "github.com/cosmos/ibc-go/v5/modules/core/exported"
ibctesting "github.com/cosmos/ibc-go/v5/testing"
clienttypes "github.com/cosmos/ibc-go/v6/modules/core/02-client/types"
ibcexported "github.com/cosmos/ibc-go/v6/modules/core/exported"
ibctesting "github.com/cosmos/ibc-go/v6/testing"
)

func TestClientTestSuite(t *testing.T) {
Expand Down
14 changes: 7 additions & 7 deletions e2e/tests/interchain_accounts/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"context"
"testing"

ibctest "github.com/strangelove-ventures/ibctest"
"github.com/strangelove-ventures/ibctest/chain/cosmos"
"github.com/strangelove-ventures/ibctest/ibc"
"github.com/strangelove-ventures/ibctest/test"
ibctest "github.com/strangelove-ventures/ibctest/v6"
"github.com/strangelove-ventures/ibctest/v6/chain/cosmos"
"github.com/strangelove-ventures/ibctest/v6/ibc"
"github.com/strangelove-ventures/ibctest/v6/test"
"github.com/stretchr/testify/suite"
"golang.org/x/mod/semver"

Expand All @@ -19,9 +19,9 @@ import (
"github.com/cosmos/ibc-go/e2e/testsuite"
"github.com/cosmos/ibc-go/e2e/testvalues"

icatypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/types"
feetypes "github.com/cosmos/ibc-go/v5/modules/apps/29-fee/types"
ibctesting "github.com/cosmos/ibc-go/v5/testing"
icatypes "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/types"
feetypes "github.com/cosmos/ibc-go/v6/modules/apps/29-fee/types"
ibctesting "github.com/cosmos/ibc-go/v6/testing"
)

func TestInterchainAccountsTestSuite(t *testing.T) {
Expand Down
10 changes: 5 additions & 5 deletions e2e/tests/interchain_accounts/incentivized_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
intertxtypes "github.com/cosmos/interchain-accounts/x/inter-tx/types"
ibctest "github.com/strangelove-ventures/ibctest"
"github.com/strangelove-ventures/ibctest/ibc"
"github.com/strangelove-ventures/ibctest/test"
ibctest "github.com/strangelove-ventures/ibctest/v6"
"github.com/strangelove-ventures/ibctest/v6/ibc"
"github.com/strangelove-ventures/ibctest/v6/test"
"github.com/stretchr/testify/suite"

"github.com/cosmos/ibc-go/e2e/testvalues"
feetypes "github.com/cosmos/ibc-go/v5/modules/apps/29-fee/types"
ibctesting "github.com/cosmos/ibc-go/v5/testing"
feetypes "github.com/cosmos/ibc-go/v6/modules/apps/29-fee/types"
ibctesting "github.com/cosmos/ibc-go/v6/testing"
)

func TestIncentivizedInterchainAccountsTestSuite(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions e2e/tests/transfer/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import (
"time"

paramsproposaltypes "github.com/cosmos/cosmos-sdk/x/params/types/proposal"
"github.com/strangelove-ventures/ibctest/ibc"
"github.com/strangelove-ventures/ibctest/test"
"github.com/strangelove-ventures/ibctest/v6/ibc"
"github.com/strangelove-ventures/ibctest/v6/test"
"github.com/stretchr/testify/suite"

"github.com/cosmos/ibc-go/e2e/testsuite"
"github.com/cosmos/ibc-go/e2e/testvalues"
transfertypes "github.com/cosmos/ibc-go/v5/modules/apps/transfer/types"
ibctesting "github.com/cosmos/ibc-go/v5/testing"
transfertypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"
ibctesting "github.com/cosmos/ibc-go/v6/testing"
)

func TestTransferTestSuite(t *testing.T) {
Expand Down
10 changes: 5 additions & 5 deletions e2e/tests/transfer/incentivized_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import (
"time"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/strangelove-ventures/ibctest/ibc"
"github.com/strangelove-ventures/ibctest/test"
"github.com/strangelove-ventures/ibctest/v6/ibc"
"github.com/strangelove-ventures/ibctest/v6/test"
"github.com/stretchr/testify/suite"

"github.com/cosmos/ibc-go/e2e/testvalues"
feetypes "github.com/cosmos/ibc-go/v5/modules/apps/29-fee/types"
transfertypes "github.com/cosmos/ibc-go/v5/modules/apps/transfer/types"
channeltypes "github.com/cosmos/ibc-go/v5/modules/core/04-channel/types"
feetypes "github.com/cosmos/ibc-go/v6/modules/apps/29-fee/types"
transfertypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"
channeltypes "github.com/cosmos/ibc-go/v6/modules/core/04-channel/types"
)

type IncentivizedTransferTestSuite struct {
Expand Down
6 changes: 3 additions & 3 deletions e2e/tests/upgrades/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"time"

upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/strangelove-ventures/ibctest/chain/cosmos"
"github.com/strangelove-ventures/ibctest/ibc"
"github.com/strangelove-ventures/ibctest/test"
"github.com/strangelove-ventures/ibctest/v6/chain/cosmos"
"github.com/strangelove-ventures/ibctest/v6/ibc"
"github.com/strangelove-ventures/ibctest/v6/test"
"github.com/stretchr/testify/suite"

"github.com/cosmos/ibc-go/e2e/testconfig"
Expand Down
12 changes: 6 additions & 6 deletions e2e/testsuite/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (

govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
intertxtypes "github.com/cosmos/interchain-accounts/x/inter-tx/types"
"github.com/strangelove-ventures/ibctest/chain/cosmos"
"github.com/strangelove-ventures/ibctest/ibc"
"github.com/strangelove-ventures/ibctest/v6/chain/cosmos"
"github.com/strangelove-ventures/ibctest/v6/ibc"

feetypes "github.com/cosmos/ibc-go/v5/modules/apps/29-fee/types"
clienttypes "github.com/cosmos/ibc-go/v5/modules/core/02-client/types"
channeltypes "github.com/cosmos/ibc-go/v5/modules/core/04-channel/types"
ibcexported "github.com/cosmos/ibc-go/v5/modules/core/exported"
feetypes "github.com/cosmos/ibc-go/v6/modules/apps/29-fee/types"
clienttypes "github.com/cosmos/ibc-go/v6/modules/core/02-client/types"
channeltypes "github.com/cosmos/ibc-go/v6/modules/core/04-channel/types"
ibcexported "github.com/cosmos/ibc-go/v6/modules/core/exported"
)

// QueryClientState queries the client state on the given chain for the provided clientID.
Expand Down
15 changes: 11 additions & 4 deletions e2e/testsuite/relayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,28 @@ import (
"testing"

dockerclient "github.com/docker/docker/client"
"github.com/strangelove-ventures/ibctest"
"github.com/strangelove-ventures/ibctest/ibc"
"github.com/strangelove-ventures/ibctest/relayer"
"github.com/strangelove-ventures/ibctest/v6"
"github.com/strangelove-ventures/ibctest/v6/ibc"
"github.com/strangelove-ventures/ibctest/v6/relayer"
"go.uber.org/zap"

"github.com/cosmos/ibc-go/e2e/testconfig"
)

const (
cosmosRelayerRepository = "ghcr.io/cosmos/relayer"
cosmosRelayerUser = "100:1000" // docker run -it --rm --entrypoint echo ghcr.io/cosmos/relayer "$(id -u):$(id -g)"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be a const in ibctest.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice suggestion, opened an issue strangelove-ventures/interchaintest#321

)

// newCosmosRelayer returns an instance of the go relayer.
// Options are used to allow for relayer version selection and specifying the default processing option.
func newCosmosRelayer(t *testing.T, tc testconfig.TestConfig, logger *zap.Logger, dockerClient *dockerclient.Client, network string) ibc.Relayer {
return ibctest.NewBuiltinRelayerFactory(ibc.CosmosRly, logger, relayer.CustomDockerImage(cosmosRelayerRepository, tc.RlyTag), relayer.StartupFlags("-p", "events")).Build(
customImageOption := relayer.CustomDockerImage(cosmosRelayerRepository, tc.RlyTag, cosmosRelayerUser)
relayerProcessingOption := relayer.StartupFlags("-p", "events") // relayer processes via events

relayerFactory := ibctest.NewBuiltinRelayerFactory(ibc.CosmosRly, logger, customImageOption, relayerProcessingOption)

return relayerFactory.Build(
Comment on lines +21 to +28
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

decided to breakup this function a little to increase readability

t, dockerClient, network,
)
}
46 changes: 23 additions & 23 deletions e2e/testsuite/testsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (
paramsproposaltypes "github.com/cosmos/cosmos-sdk/x/params/types/proposal"
intertxtypes "github.com/cosmos/interchain-accounts/x/inter-tx/types"
dockerclient "github.com/docker/docker/client"
"github.com/strangelove-ventures/ibctest"
"github.com/strangelove-ventures/ibctest/chain/cosmos"
"github.com/strangelove-ventures/ibctest/ibc"
"github.com/strangelove-ventures/ibctest/test"
"github.com/strangelove-ventures/ibctest/testreporter"
"github.com/strangelove-ventures/ibctest/v6"
"github.com/strangelove-ventures/ibctest/v6/chain/cosmos"
"github.com/strangelove-ventures/ibctest/v6/ibc"
"github.com/strangelove-ventures/ibctest/v6/test"
"github.com/strangelove-ventures/ibctest/v6/testreporter"
"github.com/stretchr/testify/suite"
"go.uber.org/zap"
"go.uber.org/zap/zaptest"
Expand All @@ -24,10 +24,10 @@ import (

"github.com/cosmos/ibc-go/e2e/testconfig"
"github.com/cosmos/ibc-go/e2e/testvalues"
feetypes "github.com/cosmos/ibc-go/v5/modules/apps/29-fee/types"
transfertypes "github.com/cosmos/ibc-go/v5/modules/apps/transfer/types"
clienttypes "github.com/cosmos/ibc-go/v5/modules/core/02-client/types"
channeltypes "github.com/cosmos/ibc-go/v5/modules/core/04-channel/types"
feetypes "github.com/cosmos/ibc-go/v6/modules/apps/29-fee/types"
transfertypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"
clienttypes "github.com/cosmos/ibc-go/v6/modules/core/02-client/types"
channeltypes "github.com/cosmos/ibc-go/v6/modules/core/04-channel/types"
)

const (
Expand Down Expand Up @@ -117,28 +117,28 @@ func (s *E2ETestSuite) SetupChainsRelayerAndChannel(ctx context.Context, channel

pathName := s.generatePathName()

channelOptions := ibc.DefaultChannelOpts()
for _, opt := range channelOpts {
opt(&channelOptions)
}

ic := ibctest.NewInterchain().
AddChain(chainA).
AddChain(chainB).
AddRelayer(r, "r").
AddLink(ibctest.InterchainLink{
Chain1: chainA,
Chain2: chainB,
Relayer: r,
Path: pathName,
Chain1: chainA,
Chain2: chainB,
Relayer: r,
Path: pathName,
CreateChannelOpts: channelOptions,
})

channelOptions := ibc.DefaultChannelOpts()
for _, opt := range channelOpts {
opt(&channelOptions)
}

eRep := s.GetRelayerExecReporter()
s.Require().NoError(ic.Build(ctx, eRep, ibctest.InterchainBuildOptions{
TestName: s.T().Name(),
Client: s.DockerClient,
NetworkID: s.network,
CreateChannelOpts: channelOptions,
TestName: s.T().Name(),
Client: s.DockerClient,
NetworkID: s.network,
}))

s.startRelayerFn = func(relayer ibc.Relayer) {
Expand Down Expand Up @@ -453,7 +453,7 @@ func (s *E2ETestSuite) ExecuteGovProposal(ctx context.Context, chain *cosmos.Cos
s.Require().NoError(err)
s.Require().Equal(govtypes.StatusVotingPeriod, proposal.Status)

err = chain.VoteOnProposalAllValidators(ctx, "1", ibc.ProposalVoteYes)
err = chain.VoteOnProposalAllValidators(ctx, "1", cosmos.ProposalVoteYes)
s.Require().NoError(err)

// ensure voting period has not passed before validators finished voting
Expand Down
4 changes: 2 additions & 2 deletions e2e/testvalues/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"time"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/strangelove-ventures/ibctest/ibc"
"github.com/strangelove-ventures/ibctest/v6/ibc"

feetypes "github.com/cosmos/ibc-go/v5/modules/apps/29-fee/types"
feetypes "github.com/cosmos/ibc-go/v6/modules/apps/29-fee/types"
)

const (
Expand Down