Skip to content

Commit

Permalink
Add test for IBC with chains pre/post SDK 47 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
agouin committed Jan 11, 2023
1 parent 5c408d4 commit 11c4f7c
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 0 deletions.
14 changes: 14 additions & 0 deletions configuredChains.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,20 @@ icad:
uid-gid: 1025:1025
no-host-mount: false

ibc-go-simd:
name: ibc-go-simd
type: cosmos
bin: simd
bech32-prefix: cosmos
denom: photon
gas-prices: 0.0photon
gas-adjustment: 1.2
trusting-period: 504h
images:
- repository: ghcr.io/strangelove-ventures/heighliner/ibc-go-simd
uid-gid: 1025:1025
no-host-mount: false

juno:
name: juno
type: cosmos
Expand Down
89 changes: 89 additions & 0 deletions examples/cosmos/sdk_47_boundary_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
package cosmos_test

import (
"context"
"testing"

ibctest "github.com/strangelove-ventures/ibctest/v6"
"github.com/strangelove-ventures/ibctest/v6/chain/cosmos"
"github.com/strangelove-ventures/ibctest/v6/conformance"
"github.com/strangelove-ventures/ibctest/v6/ibc"
"github.com/strangelove-ventures/ibctest/v6/relayer"
"github.com/strangelove-ventures/ibctest/v6/relayer/rly"
"github.com/strangelove-ventures/ibctest/v6/testreporter"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"
)

func TestSDK47Boundary(t *testing.T) {
if testing.Short() {
t.Skip("skipping in short mode")
}

t.Parallel()

cf := ibctest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*ibctest.ChainSpec{
{
Name: "gaia",
ChainName: "gaia",
Version: "v7.0.3",
},
{
Name: "ibc-go-simd",
ChainName: "ibc-go-simd",
Version: "andrew-47-rc1",
},
})

chains, err := cf.Chains(t.Name())
require.NoError(t, err)

client, network := ibctest.DockerSetup(t)

chain, counterpartyChain := chains[0].(*cosmos.CosmosChain), chains[1].(*cosmos.CosmosChain)

const (
path = "ibc-path"
relayerName = "relayer"
)

// Get a relayer instance
rf := ibctest.NewBuiltinRelayerFactory(
ibc.CosmosRly,
zaptest.NewLogger(t),
relayer.StartupFlags("-b", "100"),
relayer.CustomDockerImage("ghcr.io/cosmos/relayer", "andrew-tendermint_v0.37", rly.RlyDefaultUidGid),
relayer.ImagePull(false),
)

r := rf.Build(t, client, network)

ic := ibctest.NewInterchain().
AddChain(chain).
AddChain(counterpartyChain).
AddRelayer(r, relayerName).
AddLink(ibctest.InterchainLink{
Chain1: chain,
Chain2: counterpartyChain,
Relayer: r,
Path: path,
})

ctx := context.Background()

rep := testreporter.NewNopReporter()

require.NoError(t, ic.Build(ctx, rep.RelayerExecReporter(t), ibctest.InterchainBuildOptions{
TestName: t.Name(),
Client: client,
NetworkID: network,
BlockDatabaseFile: ibctest.DefaultBlockDatabaseFilepath(),
SkipPathCreation: false,
}))
t.Cleanup(func() {
_ = ic.Close()
})

// test IBC conformance
conformance.TestChainPair(t, ctx, client, network, chain, counterpartyChain, rf, rep, r, path)
}

0 comments on commit 11c4f7c

Please sign in to comment.