Skip to content

Commit

Permalink
fix interchaintest
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Jan 23, 2025
1 parent bad9d7d commit cfed28b
Show file tree
Hide file tree
Showing 12 changed files with 100 additions and 60 deletions.
13 changes: 8 additions & 5 deletions interchaintest/backup_rpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,19 @@ func TestBackupRpcs(t *testing.T) {
r := rf.Build(t, client, network)

const pathName = "chainA-chainB"

opts := ibc.CreateClientOptions{
TrustingPeriod: "24h",
}
ic := interchaintest.NewInterchain().
AddChain(chainA).
AddChain(chainB).
AddRelayer(r, "relayer").
AddLink(interchaintest.InterchainLink{
Chain1: chainA,
Chain2: chainB,
Relayer: r,
Path: pathName,
Chain1: chainA,
Chain2: chainB,
Relayer: r,
Path: pathName,
CreateClientOpts: opts,
})

rep := testreporter.NewNopReporter()
Expand Down
5 changes: 3 additions & 2 deletions interchaintest/fee_middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ func TestRelayerFeeMiddleware(t *testing.T) {
r := rf.Build(t, client, network)

const pathChainAChainB = "chainA-chainB"

opts := ibc.DefaultClientOpts()
opts.TrustingPeriod = "24h"
// Build the network
ic := interchaintest.NewInterchain().
AddChain(chainA).
Expand All @@ -73,7 +74,7 @@ func TestRelayerFeeMiddleware(t *testing.T) {
Order: ibc.Unordered,
Version: "{\"fee_version\":\"ics29-1\",\"app_version\":\"ics20-1\"}",
},
CreateClientOpts: ibc.DefaultClientOpts(),
CreateClientOpts: opts,
})

rep := testreporter.NewNopReporter()
Expand Down
25 changes: 16 additions & 9 deletions interchaintest/feegrant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,21 @@ func TestRelayerFeeGrant(t *testing.T) {
}).Build(t, nil, "")

processor.PathProcMessageCollector = make(chan *processor.PathProcessorMessageResp, 10000)

opts := ibc.CreateClientOptions{
TrustingPeriod: "24h",
}
// Prep Interchain
const ibcPath = "gaia-osmosis"
ic := interchaintest.NewInterchain().
AddChain(gaia).
AddChain(osmosis).
AddRelayer(r, "relayer").
AddLink(interchaintest.InterchainLink{
Chain1: gaia,
Chain2: osmosis,
Relayer: r,
Path: ibcPath,
Chain1: gaia,
Chain2: osmosis,
Relayer: r,
Path: ibcPath,
CreateClientOpts: opts,
})

// Reporter/logs
Expand Down Expand Up @@ -589,15 +592,19 @@ func TestRelayerFeeGrantExternal(t *testing.T) {

// Prep Interchain
const ibcPath = "gaia-osmosis"
opts := ibc.CreateClientOptions{
TrustingPeriod: "24h",
}
ic := interchaintest.NewInterchain().
AddChain(gaia).
AddChain(osmosis).
AddRelayer(r, "relayer").
AddLink(interchaintest.InterchainLink{
Chain1: gaia,
Chain2: osmosis,
Relayer: r,
Path: ibcPath,
Chain1: gaia,
Chain2: osmosis,
Relayer: r,
Path: ibcPath,
CreateClientOpts: opts,
})

// Reporter/logs
Expand Down
13 changes: 8 additions & 5 deletions interchaintest/ica_channel_close_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,19 @@ func TestScenarioICAChannelClose(t *testing.T) {
// Build the network; spin up the chains and configure the relayer
const pathName = "test-path"
const relayerName = "relayer"

opts := ibc.CreateClientOptions{
TrustingPeriod: "24h",
}
ic := interchaintest.NewInterchain().
AddChain(chain1).
AddChain(chain2).
AddRelayer(r, relayerName).
AddLink(interchaintest.InterchainLink{
Chain1: chain1,
Chain2: chain2,
Relayer: r,
Path: pathName,
Chain1: chain1,
Chain2: chain2,
Relayer: r,
Path: pathName,
CreateClientOpts: opts,
})

require.NoError(t, ic.Build(ctx, eRep, interchaintest.InterchainBuildOptions{
Expand Down
13 changes: 8 additions & 5 deletions interchaintest/interchain_accounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,19 @@ func TestScenarioInterchainAccounts(t *testing.T) {
// Build the network; spin up the chains and configure the relayer
const pathName = "test-path"
const relayerName = "relayer"

opts := ibc.CreateClientOptions{
TrustingPeriod: "24h",
}
ic := interchaintest.NewInterchain().
AddChain(chain1).
AddChain(chain2).
AddRelayer(r, relayerName).
AddLink(interchaintest.InterchainLink{
Chain1: chain1,
Chain2: chain2,
Relayer: r,
Path: pathName,
Chain1: chain1,
Chain2: chain2,
Relayer: r,
Path: pathName,
CreateClientOpts: opts,
})

require.NoError(t, ic.Build(ctx, eRep, interchaintest.InterchainBuildOptions{
Expand Down
4 changes: 3 additions & 1 deletion interchaintest/memo_receiver_limit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ func TestMemoAndReceiverLimit(t *testing.T) {
r := rf.Build(t, client, network)

const pathName = "chainA-chainB"

ic := interchaintest.NewInterchain().
AddChain(chainA).
AddChain(chainB).
Expand All @@ -95,6 +94,9 @@ func TestMemoAndReceiverLimit(t *testing.T) {
Chain2: chainB,
Relayer: r,
Path: pathName,
CreateClientOpts: ibc.CreateClientOptions{
TrustingPeriod: "24h",
},
})

rep := testreporter.NewNopReporter()
Expand Down
1 change: 0 additions & 1 deletion interchaintest/misbehaviour_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ func TestRelayerMisbehaviourDetection(t *testing.T) {
r := rf.Build(t, client, network)

const pathChainAChainB = "chainA-chainB"

ic := interchaintest.NewInterchain().
AddChain(chainA).
AddChain(chainB).
Expand Down
13 changes: 8 additions & 5 deletions interchaintest/multi_channel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,19 @@ func TestMultipleChannelsOneConnection(t *testing.T) {
// Build the network; spin up the chains and configure the relayer
const pathGaiaOsmosis = "gaia-osmosis"
const relayerName = "relayer"

opts := ibc.CreateClientOptions{
TrustingPeriod: "24h",
}
ic := interchaintest.NewInterchain().
AddChain(gaia).
AddChain(osmosis).
AddRelayer(r, relayerName).
AddLink(interchaintest.InterchainLink{
Chain1: gaia,
Chain2: osmosis,
Relayer: r,
Path: pathGaiaOsmosis,
Chain1: gaia,
Chain2: osmosis,
Relayer: r,
Path: pathGaiaOsmosis,
CreateClientOpts: opts,
})

rep := testreporter.NewNopReporter()
Expand Down
24 changes: 16 additions & 8 deletions interchaintest/path_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,19 @@ func TestScenarioPathFilterAllow(t *testing.T) {

// Prep Interchain
const ibcPath = "gaia-osmosis"
opts := ibc.CreateClientOptions{
TrustingPeriod: "24h",
}
ic := interchaintest.NewInterchain().
AddChain(gaia).
AddChain(osmosis).
AddRelayer(r, "relayer").
AddLink(interchaintest.InterchainLink{
Chain1: gaia,
Chain2: osmosis,
Relayer: r,
Path: ibcPath,
Chain1: gaia,
Chain2: osmosis,
Relayer: r,
Path: ibcPath,
CreateClientOpts: opts,
})

// Reporter/logs
Expand Down Expand Up @@ -191,15 +195,19 @@ func TestScenarioPathFilterDeny(t *testing.T) {

// Prep Interchain
const ibcPath = "gaia-osmosis"
opts := ibc.CreateClientOptions{
TrustingPeriod: "24h",
}
ic := interchaintest.NewInterchain().
AddChain(gaia).
AddChain(osmosis).
AddRelayer(r, "relayer").
AddLink(interchaintest.InterchainLink{
Chain1: gaia,
Chain2: osmosis,
Relayer: r,
Path: ibcPath,
Chain1: gaia,
Chain2: osmosis,
Relayer: r,
Path: ibcPath,
CreateClientOpts: opts,
})

rep := testreporter.NewNopReporter()
Expand Down
22 changes: 13 additions & 9 deletions interchaintest/relay_many_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,27 @@ func TestRelayerMultiplePathsSingleProcess(t *testing.T) {
const pathGaiaOsmosis = "gaia-osmosis"
const pathGaiaJuno = "gaia-juno"
const relayerName = "relayer"

opts := ibc.CreateClientOptions{
TrustingPeriod: "24h",
}
ic := interchaintest.NewInterchain().
AddChain(gaia).
AddChain(osmosis).
AddChain(juno).
AddRelayer(r, relayerName).
AddLink(interchaintest.InterchainLink{
Chain1: gaia,
Chain2: osmosis,
Relayer: r,
Path: pathGaiaOsmosis,
Chain1: gaia,
Chain2: osmosis,
Relayer: r,
Path: pathGaiaOsmosis,
CreateClientOpts: opts,
}).
AddLink(interchaintest.InterchainLink{
Chain1: gaia,
Chain2: juno,
Relayer: r,
Path: pathGaiaJuno,
Chain1: gaia,
Chain2: juno,
Relayer: r,
Path: pathGaiaJuno,
CreateClientOpts: opts,
})

client, network := interchaintest.DockerSetup(t)
Expand Down
13 changes: 8 additions & 5 deletions interchaintest/relayer_override_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,19 @@ func TestClientOverrideFlag(t *testing.T) {
// Build the network; spin up the chains and configure the relayer
const pathGaiaOsmosis = "gaia-osmosis"
const relayerName = "relayer"

opts := ibc.CreateClientOptions{
TrustingPeriod: "24h",
}
ic := interchaintest.NewInterchain().
AddChain(gaia).
AddChain(osmosis).
AddRelayer(r, relayerName).
AddLink(interchaintest.InterchainLink{
Chain1: gaia,
Chain2: osmosis,
Relayer: r,
Path: pathGaiaOsmosis,
Chain1: gaia,
Chain2: osmosis,
Relayer: r,
Path: pathGaiaOsmosis,
CreateClientOpts: opts,
})

require.NoError(t, ic.Build(ctx, eRep, interchaintest.InterchainBuildOptions{
Expand Down
14 changes: 9 additions & 5 deletions interchaintest/tendermint_v0.37_boundary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/strangelove-ventures/interchaintest/v9"
"github.com/strangelove-ventures/interchaintest/v9/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v9/conformance"
"github.com/strangelove-ventures/interchaintest/v9/ibc"
"github.com/strangelove-ventures/interchaintest/v9/testreporter"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"
Expand Down Expand Up @@ -58,16 +59,19 @@ func TestScenarioTendermint37Boundary(t *testing.T) {
r := rf.Build(t, client, network)

t.Parallel()

opts := ibc.CreateClientOptions{
TrustingPeriod: "24h",
}
ic := interchaintest.NewInterchain().
AddChain(chain).
AddChain(counterpartyChain).
AddRelayer(r, relayerName).
AddLink(interchaintest.InterchainLink{
Chain1: chain,
Chain2: counterpartyChain,
Relayer: r,
Path: path,
Chain1: chain,
Chain2: counterpartyChain,
Relayer: r,
Path: path,
CreateClientOpts: opts,
})

ctx := context.Background()
Expand Down

0 comments on commit cfed28b

Please sign in to comment.