diff --git a/blockdb/messages_view_test.go b/blockdb/messages_view_test.go index ae4e0c0ee..9cd73bf61 100644 --- a/blockdb/messages_view_test.go +++ b/blockdb/messages_view_test.go @@ -32,11 +32,11 @@ func TestMessagesView(t *testing.T) { client, network := interchaintest.DockerSetup(t) - const gaia0ChainID = "g0" - const gaia1ChainID = "g1" + const chainID0 = "c0" + const chainID1 = "c1" cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ - {Name: "gaia", Version: "v7.0.1", ChainConfig: ibc.ChainConfig{ChainID: gaia0ChainID}}, - {Name: "gaia", Version: "v7.0.1", ChainConfig: ibc.ChainConfig{ChainID: gaia1ChainID}}, + {Name: testutil.TestSimd, Version: testutil.SimdVerion, ChainConfig: ibc.ChainConfig{ChainID: chainID0}}, + {Name: testutil.TestSimd, Version: testutil.SimdVerion, ChainConfig: ibc.ChainConfig{ChainID: chainID1}}, }) chains, err := cf.Chains(t.Name()) @@ -93,7 +93,7 @@ func TestMessagesView(t *testing.T) { // Generate the path. // No transactions happen here. const pathName = "p" - require.NoError(t, r.GeneratePath(ctx, eRep, gaia0ChainID, gaia1ChainID, pathName)) + require.NoError(t, r.GeneratePath(ctx, eRep, chainID0, chainID1, pathName)) t.Run("create clients", func(t *testing.T) { // Creating the clients will cause transactions. @@ -105,11 +105,11 @@ client_chain_id FROM v_cosmos_messages WHERE type = "/ibc.core.client.v1.MsgCreateClient" AND chain_id = ?;` var clientChainID string - require.NoError(t, db.QueryRow(qCreateClient, gaia0ChainID).Scan(&clientChainID)) - require.Equal(t, gaia1ChainID, clientChainID) + require.NoError(t, db.QueryRow(qCreateClient, chainID0).Scan(&clientChainID)) + require.Equal(t, chainID1, clientChainID) - require.NoError(t, db.QueryRow(qCreateClient, gaia1ChainID).Scan(&clientChainID)) - require.Equal(t, gaia0ChainID, clientChainID) + require.NoError(t, db.QueryRow(qCreateClient, chainID1).Scan(&clientChainID)) + require.Equal(t, chainID0, clientChainID) }) if t.Failed() { return @@ -126,7 +126,7 @@ WHERE type = "/ibc.core.client.v1.MsgCreateClient" AND chain_id = ?;` // Wait for another block before retrieving the connections and querying for them. require.NoError(t, testutil.WaitForBlocks(ctx, 1, gaia0, gaia1)) - conns, err := r.GetConnections(ctx, eRep, gaia0ChainID) + conns, err := r.GetConnections(ctx, eRep, chainID0) require.NoError(t, err) // Collect the reported client IDs. @@ -142,7 +142,7 @@ FROM v_cosmos_messages WHERE type = "/ibc.core.connection.v1.MsgConnectionOpenInit" AND chain_id = ? ` var clientID, counterpartyClientID string - require.NoError(t, db.QueryRow(qConnectionOpenInit, gaia0ChainID).Scan(&clientID, &counterpartyClientID)) + require.NoError(t, db.QueryRow(qConnectionOpenInit, chainID0).Scan(&clientID, &counterpartyClientID)) require.Equal(t, clientID, gaia0ClientID) require.Equal(t, counterpartyClientID, gaia1ClientID) @@ -153,7 +153,7 @@ FROM v_cosmos_messages WHERE type = "/ibc.core.connection.v1.MsgConnectionOpenTry" AND chain_id = ? ` var counterpartyConnID string - require.NoError(t, db.QueryRow(qConnectionOpenTry, gaia1ChainID).Scan(&counterpartyClientID, &counterpartyConnID)) + require.NoError(t, db.QueryRow(qConnectionOpenTry, chainID1).Scan(&counterpartyClientID, &counterpartyConnID)) require.Equal(t, counterpartyClientID, gaia0ClientID) require.Equal(t, counterpartyConnID, gaia0ConnID) @@ -164,7 +164,7 @@ FROM v_cosmos_messages WHERE type = "/ibc.core.connection.v1.MsgConnectionOpenAck" AND chain_id = ? ` var connID string - require.NoError(t, db.QueryRow(qConnectionOpenAck, gaia0ChainID).Scan(&connID, &counterpartyConnID)) + require.NoError(t, db.QueryRow(qConnectionOpenAck, chainID0).Scan(&connID, &counterpartyConnID)) require.Equal(t, connID, gaia0ConnID) require.Equal(t, counterpartyConnID, gaia1ConnID) @@ -174,7 +174,7 @@ conn_id FROM v_cosmos_messages WHERE type = "/ibc.core.connection.v1.MsgConnectionOpenConfirm" AND chain_id = ? ` - require.NoError(t, db.QueryRow(qConnectionOpenConfirm, gaia1ChainID).Scan(&connID)) + require.NoError(t, db.QueryRow(qConnectionOpenConfirm, chainID1).Scan(&connID)) require.Equal(t, connID, gaia0ConnID) // Not sure if this should be connection 0 or 1, as they are typically equal during this test. }) if t.Failed() { @@ -194,7 +194,7 @@ WHERE type = "/ibc.core.connection.v1.MsgConnectionOpenConfirm" AND chain_id = ? // Wait for another block before retrieving the channels and querying for them. require.NoError(t, testutil.WaitForBlocks(ctx, 1, gaia0, gaia1)) - channels, err := r.GetChannels(ctx, eRep, gaia0ChainID) + channels, err := r.GetChannels(ctx, eRep, chainID0) require.NoError(t, err) require.Len(t, channels, 1) @@ -208,7 +208,7 @@ FROM v_cosmos_messages WHERE type = "/ibc.core.channel.v1.MsgChannelOpenInit" AND chain_id = ? ` var portID, counterpartyPortID string - require.NoError(t, db.QueryRow(qChannelOpenInit, gaia0ChainID).Scan(&portID, &counterpartyPortID)) + require.NoError(t, db.QueryRow(qChannelOpenInit, chainID0).Scan(&portID, &counterpartyPortID)) require.Equal(t, gaia0Port, portID) require.Equal(t, gaia1Port, counterpartyPortID) @@ -219,7 +219,7 @@ FROM v_cosmos_messages WHERE type = "/ibc.core.channel.v1.MsgChannelOpenTry" AND chain_id = ? ` var counterpartyChannelID string - require.NoError(t, db.QueryRow(qChannelOpenTry, gaia1ChainID).Scan(&portID, &counterpartyPortID, &counterpartyChannelID)) + require.NoError(t, db.QueryRow(qChannelOpenTry, chainID1).Scan(&portID, &counterpartyPortID, &counterpartyChannelID)) require.Equal(t, gaia1Port, portID) require.Equal(t, gaia0Port, counterpartyPortID) require.Equal(t, counterpartyChannelID, gaia0ChannelID) @@ -231,7 +231,7 @@ FROM v_cosmos_messages WHERE type = "/ibc.core.channel.v1.MsgChannelOpenAck" AND chain_id = ? ` var channelID string - require.NoError(t, db.QueryRow(qChannelOpenAck, gaia0ChainID).Scan(&portID, &channelID, &counterpartyChannelID)) + require.NoError(t, db.QueryRow(qChannelOpenAck, chainID0).Scan(&portID, &channelID, &counterpartyChannelID)) require.Equal(t, gaia0Port, portID) require.Equal(t, channelID, gaia0ChannelID) require.Equal(t, counterpartyChannelID, gaia1ChannelID) @@ -242,7 +242,7 @@ port_id, channel_id FROM v_cosmos_messages WHERE type = "/ibc.core.channel.v1.MsgChannelOpenConfirm" AND chain_id = ? ` - require.NoError(t, db.QueryRow(qChannelOpenConfirm, gaia1ChainID).Scan(&portID, &channelID)) + require.NoError(t, db.QueryRow(qChannelOpenConfirm, chainID1).Scan(&portID, &channelID)) require.Equal(t, gaia1Port, portID) require.Equal(t, channelID, gaia1ChannelID) }) @@ -274,7 +274,7 @@ FROM v_cosmos_messages WHERE type = "/ibc.applications.transfer.v1.MsgTransfer" AND chain_id = ? ` var portID, channelID string - require.NoError(t, db.QueryRow(qMsgTransfer, gaia0ChainID).Scan(&portID, &channelID)) + require.NoError(t, db.QueryRow(qMsgTransfer, chainID0).Scan(&portID, &channelID)) require.Equal(t, gaia0Port, portID) require.Equal(t, channelID, gaia0ChannelID) }) @@ -298,7 +298,7 @@ WHERE type = "/ibc.core.channel.v1.MsgRecvPacket" AND chain_id = ? var portID, channelID, counterpartyPortID, counterpartyChannelID string - require.NoError(t, db.QueryRow(qMsgRecvPacket, gaia1ChainID).Scan(&portID, &channelID, &counterpartyPortID, &counterpartyChannelID)) + require.NoError(t, db.QueryRow(qMsgRecvPacket, chainID1).Scan(&portID, &channelID, &counterpartyPortID, &counterpartyChannelID)) require.Equal(t, gaia0Port, portID) require.Equal(t, channelID, gaia0ChannelID) @@ -310,7 +310,7 @@ port_id, channel_id, counterparty_port_id, counterparty_channel_id FROM v_cosmos_messages WHERE type = "/ibc.core.channel.v1.MsgAcknowledgement" AND chain_id = ? ` - require.NoError(t, db.QueryRow(qMsgAck, gaia0ChainID).Scan(&portID, &channelID, &counterpartyPortID, &counterpartyChannelID)) + require.NoError(t, db.QueryRow(qMsgAck, chainID0).Scan(&portID, &channelID, &counterpartyPortID, &counterpartyChannelID)) require.Equal(t, gaia0Port, portID) require.Equal(t, channelID, gaia0ChannelID) diff --git a/cmd/interchaintest/interchaintest_test.go b/cmd/interchaintest/interchaintest_test.go index 32320fc7a..c26bb8906 100644 --- a/cmd/interchaintest/interchaintest_test.go +++ b/cmd/interchaintest/interchaintest_test.go @@ -21,6 +21,7 @@ import ( "github.com/strangelove-ventures/interchaintest/v8/ibc" "github.com/strangelove-ventures/interchaintest/v8/relayer" "github.com/strangelove-ventures/interchaintest/v8/testreporter" + "github.com/strangelove-ventures/interchaintest/v8/testutil" ) func init() { @@ -104,8 +105,8 @@ func setUpTestMatrix() error { testMatrix.Relayers = []string{"rly", "hermes"} testMatrix.ChainSets = [][]*interchaintest.ChainSpec{ { - {Name: "gaia", Version: "v7.0.1"}, - {Name: "osmosis", Version: "v7.2.0"}, + {Name: testutil.TestSimd, Version: testutil.SimdVerion, ChainName: "c1"}, + {Name: testutil.TestSimd, Version: testutil.SimdVerion, ChainName: "c2"}, }, } diff --git a/examples/cosmos/sdk_boundary_test.go b/examples/cosmos/sdk_boundary_test.go index 1d28bea8b..81399a0b2 100644 --- a/examples/cosmos/sdk_boundary_test.go +++ b/examples/cosmos/sdk_boundary_test.go @@ -36,10 +36,10 @@ func TestSDKBoundaries(t *testing.T) { Name: "gaia", ChainName: "gaia", Version: "v7.0.3", // sdk 0.45.6 }, { - Name: "ibc-go-simd", ChainName: "simd-50", Version: "feat-upgrade-sdk-v0.50", // sdk 0.50 alpha + Name: "ibc-go-simd", ChainName: "simd-50", Version: "v8.5.1", // sdk v0.50.10 }, }, - relayerVersion: "colin-event-fix", + relayerVersion: "v2.5.2", }, { name: "sdk 47 <-> 50", @@ -48,10 +48,10 @@ func TestSDKBoundaries(t *testing.T) { Name: "ibc-go-simd", ChainName: "simd-47", Version: "v7.2.0", // sdk 0.47.3 }, { - Name: "ibc-go-simd", ChainName: "simd-50", Version: "feat-upgrade-sdk-v0.50", // sdk 0.50 alpha + Name: "ibc-go-simd", ChainName: "simd-50", Version: "v8.5.1", // sdk v0.50.10 }, }, - relayerVersion: "colin-event-fix", + relayerVersion: "v2.5.2", }, } diff --git a/interchain_test.go b/interchain_test.go index 923ec8b64..4e19fe60e 100644 --- a/interchain_test.go +++ b/interchain_test.go @@ -51,8 +51,8 @@ func duplicateChainTest(t *testing.T, relayerImpl ibc.RelayerImplementation) { cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ // Two otherwise identical chains that only differ by ChainID. - {Name: "gaia", ChainName: "g1", Version: "v7.0.1"}, - {Name: "gaia", ChainName: "g2", Version: "v7.0.1"}, + {Name: testutil.TestSimd, ChainName: "c1", Version: testutil.SimdVerion}, + {Name: testutil.TestSimd, ChainName: "c2", Version: testutil.SimdVerion}, }) chains, err := cf.Chains(t.Name()) @@ -109,8 +109,8 @@ func getRelayerWalletsTest(t *testing.T, relayerImpl ibc.RelayerImplementation) cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ // Two otherwise identical chains that only differ by ChainID. - {Name: "gaia", ChainName: "g1", Version: "v7.0.1", ChainConfig: ibc.ChainConfig{ChainID: "cosmoshub-0"}}, - {Name: "gaia", ChainName: "g2", Version: "v7.0.1", ChainConfig: ibc.ChainConfig{ChainID: "cosmoshub-1"}}, + {Name: testutil.TestSimd, ChainName: "c1", Version: testutil.SimdVerion, ChainConfig: ibc.ChainConfig{ChainID: "chain-0"}}, + {Name: testutil.TestSimd, ChainName: "c2", Version: testutil.SimdVerion, ChainConfig: ibc.ChainConfig{ChainID: "chain-1"}}, }) chains, err := cf.Chains(t.Name()) @@ -187,8 +187,7 @@ func TestInterchain_CreateUser(t *testing.T) { client, network := interchaintest.DockerSetup(t) cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ - // Two otherwise identical chains that only differ by ChainID. - {Name: "gaia", ChainName: "g1", Version: "v7.0.1", ChainConfig: ibc.ChainConfig{ChainID: "cosmoshub-0"}}, + {Name: testutil.TestSimd, ChainName: "c1", Version: testutil.SimdVerion, ChainConfig: ibc.ChainConfig{ChainID: "chain-0"}}, }) chains, err := cf.Chains(t.Name()) @@ -301,9 +300,9 @@ func TestInterchain_ConcurrentRelayerOps(t *testing.T) { chainSpecs := make([]*interchaintest.ChainSpec, chains) for i := 0; i < chains; i++ { chainSpecs[i] = &interchaintest.ChainSpec{ - Name: "gaia", + Name: testutil.TestSimd, ChainName: fmt.Sprintf("g%d", i+1), - Version: "v7.0.1", + Version: testutil.SimdVerion, NumValidators: &numValidators, NumFullNodes: &numFullNodes, ChainConfig: ibc.ChainConfig{ @@ -365,8 +364,8 @@ func broadcastTxCosmosChainTest(t *testing.T, relayerImpl ibc.RelayerImplementat cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ // Two otherwise identical chains that only differ by ChainID. - {Name: "gaia", ChainName: "g1", Version: "v7.0.1", ChainConfig: ibc.ChainConfig{ChainID: "cosmoshub-0"}}, - {Name: "gaia", ChainName: "g2", Version: "v7.0.1", ChainConfig: ibc.ChainConfig{ChainID: "cosmoshub-1"}}, + {Name: testutil.TestSimd, ChainName: "c1", Version: testutil.SimdVerion, ChainConfig: ibc.ChainConfig{ChainID: "chain-0"}}, + {Name: testutil.TestSimd, ChainName: "c2", Version: testutil.SimdVerion, ChainConfig: ibc.ChainConfig{ChainID: "chain-1"}}, }) chains, err := cf.Chains(t.Name()) @@ -452,7 +451,7 @@ func TestInterchain_OmitGitSHA(t *testing.T) { client, network := interchaintest.DockerSetup(t) cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ - {Name: "gaia", Version: "v7.0.1"}, + {Name: testutil.TestSimd, Version: testutil.SimdVerion}, }) chains, err := cf.Chains(t.Name()) @@ -480,7 +479,7 @@ func TestInterchain_OmitGitSHA(t *testing.T) { func TestInterchain_ConflictRejection(t *testing.T) { t.Run("duplicate chain", func(t *testing.T) { cf := interchaintest.NewBuiltinChainFactory(zap.NewNop(), []*interchaintest.ChainSpec{ - {Name: "gaia", Version: "v7.0.1", ChainConfig: ibc.ChainConfig{ChainID: "cosmoshub-0"}}, + {Name: testutil.TestSimd, Version: testutil.SimdVerion, ChainConfig: ibc.ChainConfig{ChainID: "chain-0"}}, }) chains, err := cf.Chains(t.Name()) @@ -496,8 +495,8 @@ func TestInterchain_ConflictRejection(t *testing.T) { t.Run("chain name", func(t *testing.T) { cf := interchaintest.NewBuiltinChainFactory(zap.NewNop(), []*interchaintest.ChainSpec{ // Different ChainID, but explicit ChainName used twice. - {Name: "gaia", ChainName: "g", Version: "v7.0.1", ChainConfig: ibc.ChainConfig{ChainID: "cosmoshub-0"}}, - {Name: "gaia", ChainName: "g", Version: "v7.0.1", ChainConfig: ibc.ChainConfig{ChainID: "cosmoshub-1"}}, + {Name: testutil.TestSimd, ChainName: "c", Version: testutil.SimdVerion, ChainConfig: ibc.ChainConfig{ChainID: "chain-0"}}, + {Name: testutil.TestSimd, ChainName: "c", Version: testutil.SimdVerion, ChainConfig: ibc.ChainConfig{ChainID: "chain-1"}}, }) chains, err := cf.Chains(t.Name()) @@ -511,8 +510,8 @@ func TestInterchain_ConflictRejection(t *testing.T) { t.Run("chain ID", func(t *testing.T) { cf := interchaintest.NewBuiltinChainFactory(zap.NewNop(), []*interchaintest.ChainSpec{ // Valid ChainName but duplicate ChainID. - {Name: "gaia", ChainName: "g1", Version: "v7.0.1", ChainConfig: ibc.ChainConfig{ChainID: "cosmoshub-0"}}, - {Name: "gaia", ChainName: "g2", Version: "v7.0.1", ChainConfig: ibc.ChainConfig{ChainID: "cosmoshub-0"}}, + {Name: testutil.TestSimd, ChainName: "c1", Version: testutil.SimdVerion, ChainConfig: ibc.ChainConfig{ChainID: "chain-0"}}, + {Name: testutil.TestSimd, ChainName: "c2", Version: testutil.SimdVerion, ChainConfig: ibc.ChainConfig{ChainID: "chain-0"}}, }) chains, err := cf.Chains(t.Name()) diff --git a/testutil/doc.go b/testutil/doc.go index f6542ace6..92b33d3ea 100644 --- a/testutil/doc.go +++ b/testutil/doc.go @@ -1,2 +1,7 @@ // Package testutil includes convenience functions and types to help with testing package testutil + +const ( + TestSimd = "ibc-go-simd" + SimdVerion = "v8.5.1" +)