Skip to content

Commit

Permalink
chore: update test binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
boojamya committed Oct 17, 2024
1 parent 4490028 commit 5ccd454
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 44 deletions.
44 changes: 22 additions & 22 deletions blockdb/messages_view_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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.
Expand All @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand All @@ -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() {
Expand All @@ -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)

Expand All @@ -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)

Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
})
Expand Down Expand Up @@ -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)
})
Expand All @@ -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)
Expand All @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions cmd/interchaintest/interchaintest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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"},
},
}

Expand Down
8 changes: 4 additions & 4 deletions examples/cosmos/sdk_boundary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
},
}

Expand Down
31 changes: 15 additions & 16 deletions interchain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand All @@ -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())
Expand All @@ -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())
Expand Down
5 changes: 5 additions & 0 deletions testutil/doc.go
Original file line number Diff line number Diff line change
@@ -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"
)

0 comments on commit 5ccd454

Please sign in to comment.