Skip to content

Commit

Permalink
create channel for rly2
Browse files Browse the repository at this point in the history
  • Loading branch information
anhductn2001 committed Apr 12, 2024
1 parent 647735f commit b88f140
Show file tree
Hide file tree
Showing 3 changed files with 159 additions and 0 deletions.
63 changes: 63 additions & 0 deletions tests/frozen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func TestRollAppFreeze_EVM(t *testing.T) {
dymintTomlOverrides["node_address"] = fmt.Sprintf("http://dymension_100-1-val-0-%s:26657", t.Name())
dymintTomlOverrides["rollapp_id"] = "rollappevm_1234-1"
dymintTomlOverrides["gas_prices"] = "0adym"
dymintTomlOverrides["empty_blocks_max_time"] = "3s"

configFileOverrides["config/dymint.toml"] = dymintTomlOverrides
// Create chain factory with dymension
Expand Down Expand Up @@ -304,6 +305,7 @@ func TestRollAppFreeze_Wasm(t *testing.T) {
dymintTomlOverrides["node_address"] = fmt.Sprintf("http://dymension_100-1-val-0-%s:26657", t.Name())
dymintTomlOverrides["rollapp_id"] = "rollappwasm_1234-1"
dymintTomlOverrides["gas_prices"] = "0adym"
dymintTomlOverrides["empty_blocks_max_time"] = "3s"

configFileOverrides["config/dymint.toml"] = dymintTomlOverrides
// Create chain factory with dymension
Expand Down Expand Up @@ -397,6 +399,24 @@ func TestRollAppFreeze_Wasm(t *testing.T) {
})
require.NoError(t, err)

err = r.GeneratePath(ctx, eRep, dymension.Config().ChainID, rollapp1.Config().ChainID, ibcPath)
require.NoError(t, err)

err = r.CreateClients(ctx, eRep, ibcPath, ibc.DefaultClientOpts())
require.NoError(t, err)

err = testutil.WaitForBlocks(ctx, 30, dymension)
require.NoError(t, err)

r.UpdateClients(ctx, eRep, ibcPath)
require.NoError(t, err)

err = r.CreateConnections(ctx, eRep, ibcPath)
require.NoError(t, err)

err = r.CreateChannel(ctx, eRep, ibcPath, ibc.DefaultChannelOpts())
require.NoError(t, err)

err = testutil.WaitForBlocks(ctx, 5, dymension, rollapp1)
require.NoError(t, err)

Expand Down Expand Up @@ -544,6 +564,7 @@ func TestOtherRollappNotAffected_EVM(t *testing.T) {
dymintTomlOverrides["node_address"] = fmt.Sprintf("http://dymension_100-1-val-0-%s:26657", t.Name())
dymintTomlOverrides["rollapp_id"] = "rollappevm_1234-1"
dymintTomlOverrides["gas_prices"] = "0adym"
dymintTomlOverrides["empty_blocks_max_time"] = "3s"

configFileOverrides["config/dymint.toml"] = dymintTomlOverrides

Expand All @@ -553,6 +574,7 @@ func TestOtherRollappNotAffected_EVM(t *testing.T) {
dymintTomlOverrides2["node_address"] = fmt.Sprintf("http://dymension_100-1-val-0-%s:26657", t.Name())
dymintTomlOverrides2["rollapp_id"] = "rollappevm_12345-1"
dymintTomlOverrides2["gas_prices"] = "0adym"
dymintTomlOverrides2["empty_blocks_max_time"] = "3s"

configFileOverrides2["config/dymint.toml"] = dymintTomlOverrides2
// Create chain factory with dymension
Expand Down Expand Up @@ -701,6 +723,27 @@ func TestOtherRollappNotAffected_EVM(t *testing.T) {
err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1, rollapp2)
require.NoError(t, err)

err = s.GeneratePath(ctx, eRep, dymension.Config().ChainID, rollapp2.Config().ChainID, anotherIbcPath)
require.NoError(t, err)

err = s.CreateClients(ctx, eRep, anotherIbcPath, ibc.DefaultClientOpts())
require.NoError(t, err)

err = testutil.WaitForBlocks(ctx, 30, dymension)
require.NoError(t, err)

s.UpdateClients(ctx, eRep, anotherIbcPath)
require.NoError(t, err)

err = s.CreateConnections(ctx, eRep, anotherIbcPath)
require.NoError(t, err)

err = s.CreateChannel(ctx, eRep, anotherIbcPath, ibc.DefaultChannelOpts())
require.NoError(t, err)

err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1, rollapp2)
require.NoError(t, err)

// Start both relayers
err = r.StartRelayer(ctx, eRep, ibcPath)
require.NoError(t, err)
Expand Down Expand Up @@ -979,6 +1022,7 @@ func TestOtherRollappNotAffected_Wasm(t *testing.T) {
dymintTomlOverrides["node_address"] = fmt.Sprintf("http://dymension_100-1-val-0-%s:26657", t.Name())
dymintTomlOverrides["rollapp_id"] = "rollappwasm_1234-1"
dymintTomlOverrides["gas_prices"] = "0adym"
dymintTomlOverrides["empty_blocks_max_time"] = "3s"

configFileOverrides["config/dymint.toml"] = dymintTomlOverrides

Expand All @@ -988,6 +1032,7 @@ func TestOtherRollappNotAffected_Wasm(t *testing.T) {
dymintTomlOverrides2["node_address"] = fmt.Sprintf("http://dymension_100-1-val-0-%s:26657", t.Name())
dymintTomlOverrides2["rollapp_id"] = "rollappwasm_12345-1"
dymintTomlOverrides2["gas_prices"] = "0adym"
dymintTomlOverrides2["empty_blocks_max_time"] = "3s"

configFileOverrides2["config/dymint.toml"] = dymintTomlOverrides2
// Create chain factory with dymension
Expand Down Expand Up @@ -1136,6 +1181,24 @@ func TestOtherRollappNotAffected_Wasm(t *testing.T) {
err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1, rollapp2)
require.NoError(t, err)

err = s.GeneratePath(ctx, eRep, dymension.Config().ChainID, rollapp2.Config().ChainID, anotherIbcPath)
require.NoError(t, err)

err = s.CreateClients(ctx, eRep, anotherIbcPath, ibc.DefaultClientOpts())
require.NoError(t, err)

err = testutil.WaitForBlocks(ctx, 30, dymension)
require.NoError(t, err)

s.UpdateClients(ctx, eRep, anotherIbcPath)
require.NoError(t, err)

err = s.CreateConnections(ctx, eRep, anotherIbcPath)
require.NoError(t, err)

err = s.CreateChannel(ctx, eRep, anotherIbcPath, ibc.DefaultChannelOpts())
require.NoError(t, err)

// Start both relayers
err = r.StartRelayer(ctx, eRep, ibcPath)
require.NoError(t, err)
Expand Down
48 changes: 48 additions & 0 deletions tests/ibc_pfm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,30 @@ func TestIBCTransferMultiHop_EVM(t *testing.T) {
err = r.CreateChannel(ctx, eRep, ibcPath, ibc.DefaultChannelOpts())
require.NoError(t, err)

err = testutil.WaitForBlocks(ctx, 5, dymension, rollapp1)
require.NoError(t, err)

err = r2.GeneratePath(ctx, eRep, dymension.Config().ChainID, gaia.Config().ChainID, ibcPath)
require.NoError(t, err)

err = r2.CreateClients(ctx, eRep, ibcPath, ibc.DefaultClientOpts())
require.NoError(t, err)

err = testutil.WaitForBlocks(ctx, 30, dymension, gaia)
require.NoError(t, err)

r2.UpdateClients(ctx, eRep, ibcPath)
require.NoError(t, err)

err = r2.CreateConnections(ctx, eRep, ibcPath)
require.NoError(t, err)

err = r2.CreateChannel(ctx, eRep, ibcPath, ibc.DefaultChannelOpts())
require.NoError(t, err)

err = testutil.WaitForBlocks(ctx, 5, dymension, rollapp1)
require.NoError(t, err)

channsDym, err := r.GetChannels(ctx, eRep, dymension.GetChainID())
require.NoError(t, err)
require.Len(t, channsDym, 2)
Expand Down Expand Up @@ -416,6 +440,30 @@ func TestIBCTransferMultiHop_Wasm(t *testing.T) {
err = r.CreateChannel(ctx, eRep, ibcPath, ibc.DefaultChannelOpts())
require.NoError(t, err)

err = testutil.WaitForBlocks(ctx, 5, dymension, rollapp1)
require.NoError(t, err)

err = r2.GeneratePath(ctx, eRep, dymension.Config().ChainID, gaia.Config().ChainID, ibcPath)
require.NoError(t, err)

err = r2.CreateClients(ctx, eRep, ibcPath, ibc.DefaultClientOpts())
require.NoError(t, err)

err = testutil.WaitForBlocks(ctx, 30, dymension, gaia)
require.NoError(t, err)

r2.UpdateClients(ctx, eRep, ibcPath)
require.NoError(t, err)

err = r2.CreateConnections(ctx, eRep, ibcPath)
require.NoError(t, err)

err = r2.CreateChannel(ctx, eRep, ibcPath, ibc.DefaultChannelOpts())
require.NoError(t, err)

err = testutil.WaitForBlocks(ctx, 5, dymension, rollapp1)
require.NoError(t, err)

channsDym, err := r.GetChannels(ctx, eRep, dymension.GetChainID())
require.NoError(t, err)
require.Len(t, channsDym, 2)
Expand Down
48 changes: 48 additions & 0 deletions tests/ibc_pfm_with_grace_period_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,30 @@ func TestIBCPFMWithGracePeriod_EVM(t *testing.T) {
err = r.CreateChannel(ctx, eRep, ibcPath, ibc.DefaultChannelOpts())
require.NoError(t, err)

err = testutil.WaitForBlocks(ctx, 5, dymension, rollapp1)
require.NoError(t, err)

err = r2.GeneratePath(ctx, eRep, dymension.Config().ChainID, gaia.Config().ChainID, ibcPath)
require.NoError(t, err)

err = r2.CreateClients(ctx, eRep, ibcPath, ibc.DefaultClientOpts())
require.NoError(t, err)

err = testutil.WaitForBlocks(ctx, 30, dymension, gaia)
require.NoError(t, err)

r2.UpdateClients(ctx, eRep, ibcPath)
require.NoError(t, err)

err = r2.CreateConnections(ctx, eRep, ibcPath)
require.NoError(t, err)

err = r2.CreateChannel(ctx, eRep, ibcPath, ibc.DefaultChannelOpts())
require.NoError(t, err)

err = testutil.WaitForBlocks(ctx, 5, dymension, rollapp1)
require.NoError(t, err)

channsDym, err := r.GetChannels(ctx, eRep, dymension.GetChainID())
require.NoError(t, err)
require.Len(t, channsDym, 2)
Expand Down Expand Up @@ -481,6 +505,30 @@ func TestIBCPFMWithGracePeriod_Wasm(t *testing.T) {
err = r.CreateChannel(ctx, eRep, ibcPath, ibc.DefaultChannelOpts())
require.NoError(t, err)

err = testutil.WaitForBlocks(ctx, 5, dymension, rollapp1)
require.NoError(t, err)

err = r2.GeneratePath(ctx, eRep, dymension.Config().ChainID, gaia.Config().ChainID, ibcPath)
require.NoError(t, err)

err = r2.CreateClients(ctx, eRep, ibcPath, ibc.DefaultClientOpts())
require.NoError(t, err)

err = testutil.WaitForBlocks(ctx, 30, dymension, gaia)
require.NoError(t, err)

r2.UpdateClients(ctx, eRep, ibcPath)
require.NoError(t, err)

err = r2.CreateConnections(ctx, eRep, ibcPath)
require.NoError(t, err)

err = r2.CreateChannel(ctx, eRep, ibcPath, ibc.DefaultChannelOpts())
require.NoError(t, err)

err = testutil.WaitForBlocks(ctx, 5, dymension, rollapp1)
require.NoError(t, err)

channsDym, err := r.GetChannels(ctx, eRep, dymension.GetChainID())
require.NoError(t, err)
require.Len(t, channsDym, 2)
Expand Down

0 comments on commit b88f140

Please sign in to comment.