Skip to content

Commit

Permalink
Turn back the disabled tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zale144 committed Apr 4, 2024
1 parent 00fe185 commit 6e612fa
Show file tree
Hide file tree
Showing 10 changed files with 107 additions and 74 deletions.
44 changes: 35 additions & 9 deletions .github/workflows/e2e_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ jobs:
strategy:
matrix:
tests:
# - "e2e-test-ibc-success-evm"
- "e2e-test-ibc-success-evm"
- "e2e-test-ibc-timeout-evm"
# - "e2e-test-ibc-grace-period-evm"
# - "e2e-test-eibc-fulfillment-evm"
# - "e2e-test-transfer-multi-hop-evm"
# - "e2e-test-pfm-with-grace-period-evm"
# - "e2e-test-batch-finalization-evm"
# - "e2e-test-rollapp-freeze-evm"
# - "e2e-test-other-rollapp-not-affected-evm"
# - "e2e-test-rollapp-genesis-event-evm"
- "e2e-test-ibc-grace-period-evm"
- "e2e-test-eibc-fulfillment-evm"
- "e2e-test-transfer-multi-hop-evm"
- "e2e-test-pfm-with-grace-period-evm"
- "e2e-test-batch-finalization-evm"
- "e2e-test-rollapp-freeze-evm"
- "e2e-test-other-rollapp-not-affected-evm"
- "e2e-test-rollapp-genesis-event-evm"
fail-fast: false
runs-on: ubuntu-latest
steps:
Expand All @@ -49,3 +49,29 @@ jobs:
- name: Rollapp-EVM E2E Tests
run: |
make ${{ matrix.tests }}
rollapp-wasm:
strategy:
matrix:
tests:
- "e2e-test-ibc-success-wasm"
- "e2e-test-ibc-timeout-wasm"
- "e2e-test-ibc-grace-period-wasm"
- "e2e-test-eibc-fulfillment-wasm"
- "e2e-test-transfer-multi-hop-wasm"
- "e2e-test-pfm-with-grace-period-wasm"
- "e2e-test-batch-finalization-wasm"
- "e2e-test-rollapp-freeze-wasm"
- "e2e-test-other-rollapp-not-affected-wasm"
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: dymensionxyz/e2e-tests
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: "1.21.4"

- name: Rollapp-Wasm E2E Tests
run: make ${{ matrix.tests }}
14 changes: 7 additions & 7 deletions tests/eibc_fulfillment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ import (

"cosmossdk.io/math"
transfertypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"

test "github.com/decentrio/rollup-e2e-testing"
"github.com/decentrio/rollup-e2e-testing/blockdb"
"github.com/decentrio/rollup-e2e-testing/cosmos"
"github.com/decentrio/rollup-e2e-testing/cosmos/hub/dym_hub"
"github.com/decentrio/rollup-e2e-testing/cosmos/rollapp/dym_rollapp"
"github.com/decentrio/rollup-e2e-testing/ibc"

dymensiontesting "github.com/decentrio/rollup-e2e-testing/dymension"
"github.com/decentrio/rollup-e2e-testing/ibc"
"github.com/decentrio/rollup-e2e-testing/relayer"
"github.com/decentrio/rollup-e2e-testing/testreporter"
"github.com/decentrio/rollup-e2e-testing/testutil"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"
)

// This test case verifies the system's behavior when an eIBC packet sent from the rollapp to the hub
Expand Down Expand Up @@ -173,7 +173,7 @@ func TestEIBCFulfillment_EVM(t *testing.T) {
err = testutil.WaitForBlocks(ctx, 5, dymension)
require.NoError(t, err)

triggerGenesisEvent(t, dymension, rollapp1.GetChainID(), channel.ChannelID, dymensionUser)
triggerHubGenesisEvent(t, dymension, rollapp1.Config().ChainID, channel.ChannelID, dymensionUser.KeyName())

transferData := ibc.WalletData{
Address: marketMakerAddr,
Expand Down Expand Up @@ -417,10 +417,10 @@ func TestEIBCFulfillment_Wasm(t *testing.T) {

err = r.StartRelayer(ctx, eRep, ibcPath)
require.NoError(t, err)
err = testutil.WaitForBlocks(ctx, 5, dymension)
err = testutil.WaitForBlocks(ctx, 3, dymension)
require.NoError(t, err)

triggerGenesisEvent(t, dymension, rollapp1.GetChainID(), channel.ChannelID, dymensionUser)
triggerHubGenesisEvent(t, dymension, rollapp1.Config().ChainID, channel.ChannelID, dymensionUser.KeyName())

transferData := ibc.WalletData{
Address: marketMakerAddr,
Expand Down
13 changes: 7 additions & 6 deletions tests/frozen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import (

"cosmossdk.io/math"
transfertypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"

test "github.com/decentrio/rollup-e2e-testing"
"github.com/decentrio/rollup-e2e-testing/cosmos"
"github.com/decentrio/rollup-e2e-testing/cosmos/hub/dym_hub"
Expand All @@ -17,8 +20,6 @@ import (
"github.com/decentrio/rollup-e2e-testing/relayer"
"github.com/decentrio/rollup-e2e-testing/testreporter"
"github.com/decentrio/rollup-e2e-testing/testutil"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"
)

const anotherIbcPath = "dymension-demo2"
Expand Down Expand Up @@ -184,7 +185,7 @@ func TestRollAppFreeze_EVM(t *testing.T) {
require.NoError(t, err)
require.Equal(t, len(dymChannel), 1)

triggerGenesisEvent(t, dymension, rollapp1.GetChainID(), dymChannel[0].ChannelID, dymensionUser)
triggerHubGenesisEvent(t, dymension, rollapp1.Config().ChainID, dymChannel[0].ChannelID, dymensionUser.KeyName())

oldLatestIndex, err := dymension.GetNode().QueryLatestStateIndex(ctx, rollapp1.Config().ChainID)
require.NoError(t, err)
Expand Down Expand Up @@ -426,7 +427,7 @@ func TestRollAppFreeze_Wasm(t *testing.T) {
err = testutil.WaitForBlocks(ctx, 3, dymension, rollapp1)
require.NoError(t, err)

triggerGenesisEvent(t, dymension, rollapp1.GetChainID(), dymChannel[0].ChannelID, dymensionUser)
triggerHubGenesisEvent(t, dymension, rollapp1.Config().ChainID, dymChannel[0].ChannelID, dymensionUser.KeyName())

oldLatestIndex, err := dymension.GetNode().QueryLatestStateIndex(ctx, rollapp1.Config().ChainID)
require.NoError(t, err)
Expand Down Expand Up @@ -743,7 +744,7 @@ func TestOtherRollappNotAffected_EVM(t *testing.T) {
channsRollApp2Dym := channsRollApp2[0]
require.NotEmpty(t, channsRollApp2Dym.ChannelID)

triggerGenesisEvent(t, dymension, rollapp1.GetChainID(), channDymRollApp1.ChannelID, dymensionUser)
triggerHubGenesisEvent(t, dymension, rollapp1.Config().ChainID, channDymRollApp1.ChannelID, dymensionUser.KeyName())

oldLatestIndex, err := dymension.GetNode().QueryLatestStateIndex(ctx, rollapp1.Config().ChainID)
require.NoError(t, err)
Expand Down Expand Up @@ -1150,7 +1151,7 @@ func TestOtherRollappNotAffected_Wasm(t *testing.T) {
channsRollApp2Dym := channsRollApp2[0]
require.NotEmpty(t, channsRollApp2Dym.ChannelID)

triggerGenesisEvent(t, dymension, rollapp1.GetChainID(), channDymRollApp1.ChannelID, dymensionUser)
triggerHubGenesisEvent(t, dymension, rollapp1.Config().ChainID, channDymRollApp1.ChannelID, dymensionUser.KeyName())

oldLatestIndex, err := dymension.GetNode().QueryLatestStateIndex(ctx, rollapp1.Config().ChainID)
require.NoError(t, err)
Expand Down
9 changes: 5 additions & 4 deletions tests/ibc_grace_period_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import (

"cosmossdk.io/math"
transfertypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"

test "github.com/decentrio/rollup-e2e-testing"
"github.com/decentrio/rollup-e2e-testing/cosmos"
"github.com/decentrio/rollup-e2e-testing/cosmos/hub/dym_hub"
Expand All @@ -15,8 +18,6 @@ import (
"github.com/decentrio/rollup-e2e-testing/relayer"
"github.com/decentrio/rollup-e2e-testing/testreporter"
"github.com/decentrio/rollup-e2e-testing/testutil"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"
)

// TestIBCGracePeriodCompliance ensures that the grace period for transaction finalization is correctly enforced on hub and rollapp.
Expand Down Expand Up @@ -169,7 +170,7 @@ func TestIBCGracePeriodCompliance_EVM(t *testing.T) {
err = testutil.WaitForBlocks(ctx, 3, rollapp1)
require.NoError(t, err)

triggerGenesisEvent(t, dymension, rollapp1.GetChainID(), channel.ChannelID, dymensionUser)
triggerHubGenesisEvent(t, dymension, rollapp1.Config().ChainID, channel.ChannelID, dymensionUser.KeyName())

// Compose an IBC transfer and send from Hub -> rollapp
_, err = dymension.SendIBCTransfer(ctx, channel.ChannelID, dymensionUserAddr, transferData, ibc.TransferOptions{})
Expand Down Expand Up @@ -382,7 +383,7 @@ func TestIBCGracePeriodCompliance_Wasm(t *testing.T) {
err = testutil.WaitForBlocks(ctx, 3, dymension, rollapp1)
require.NoError(t, err)

triggerGenesisEvent(t, dymension, rollapp1.GetChainID(), channel.ChannelID, dymensionUser)
triggerHubGenesisEvent(t, dymension, rollapp1.Config().ChainID, channel.ChannelID, dymensionUser.KeyName())

// Compose an IBC transfer and send from Hub -> rollapp
_, err = dymension.SendIBCTransfer(ctx, channel.ChannelID, dymensionUserAddr, transferData, ibc.TransferOptions{})
Expand Down
9 changes: 5 additions & 4 deletions tests/ibc_pfm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import (

"cosmossdk.io/math"
transfertypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"

test "github.com/decentrio/rollup-e2e-testing"
"github.com/decentrio/rollup-e2e-testing/cosmos"
"github.com/decentrio/rollup-e2e-testing/cosmos/hub/dym_hub"
Expand All @@ -17,8 +20,6 @@ import (
"github.com/decentrio/rollup-e2e-testing/relayer"
"github.com/decentrio/rollup-e2e-testing/testreporter"
"github.com/decentrio/rollup-e2e-testing/testutil"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"
)

func TestIBCTransferMultiHop_EVM(t *testing.T) {
Expand Down Expand Up @@ -212,7 +213,7 @@ func TestIBCTransferMultiHop_EVM(t *testing.T) {
require.NoError(t, err)
require.Equal(t, walletAmount, gaiaOrigBal)

triggerGenesisEvent(t, dymension, rollapp1.GetChainID(), channDymRollApp.ChannelID, dymensionUser)
triggerHubGenesisEvent(t, dymension, rollapp1.Config().ChainID, channDymRollApp.ChannelID, dymensionUser.KeyName())

t.Run("multihop rollapp->dym->gaia", func(t *testing.T) {
firstHopDenom := transfertypes.GetPrefixedDenom(channDymRollApp.PortID, channDymRollApp.ChannelID, rollapp1.Config().Denom)
Expand Down Expand Up @@ -451,7 +452,7 @@ func TestIBCTransferMultiHop_Wasm(t *testing.T) {
require.NoError(t, err)
require.Equal(t, walletAmount, gaiaOrigBal)

triggerGenesisEvent(t, dymension, rollapp1.GetChainID(), channDymRollApp.ChannelID, dymensionUser)
triggerHubGenesisEvent(t, dymension, rollapp1.Config().ChainID, channDymRollApp.ChannelID, dymensionUser.KeyName())

t.Run("multihop rollapp->dym->gaia", func(t *testing.T) {
firstHopDenom := transfertypes.GetPrefixedDenom(channDymRollApp.PortID, channDymRollApp.ChannelID, rollapp1.Config().Denom)
Expand Down
9 changes: 5 additions & 4 deletions tests/ibc_pfm_with_grace_period_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import (

"cosmossdk.io/math"
transfertypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"

test "github.com/decentrio/rollup-e2e-testing"
"github.com/decentrio/rollup-e2e-testing/cosmos"
"github.com/decentrio/rollup-e2e-testing/cosmos/hub/dym_hub"
Expand All @@ -17,8 +20,6 @@ import (
"github.com/decentrio/rollup-e2e-testing/relayer"
"github.com/decentrio/rollup-e2e-testing/testreporter"
"github.com/decentrio/rollup-e2e-testing/testutil"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"
)

func TestIBCPFMWithGracePeriod_EVM(t *testing.T) {
Expand Down Expand Up @@ -236,7 +237,7 @@ func TestIBCPFMWithGracePeriod_EVM(t *testing.T) {
require.NoError(t, err)
require.Equal(t, walletAmount, gaiaOrigBal)

triggerGenesisEvent(t, dymension, rollapp1.GetChainID(), channDymRollApp.ChannelID, dymensionUser)
triggerHubGenesisEvent(t, dymension, rollapp1.Config().ChainID, channDymRollApp.ChannelID, dymensionUser.KeyName())

t.Run("multihop rollapp->dym->gaia, funds received on gaia after grace period", func(t *testing.T) {
firstHopDenom := transfertypes.GetPrefixedDenom(channDymRollApp.PortID, channDymRollApp.ChannelID, rollapp1.Config().Denom)
Expand Down Expand Up @@ -516,7 +517,7 @@ func TestIBCPFMWithGracePeriod_Wasm(t *testing.T) {
require.NoError(t, err)
require.Equal(t, walletAmount, gaiaOrigBal)

triggerGenesisEvent(t, dymension, rollapp1.GetChainID(), channDymRollApp.ChannelID, dymensionUser)
triggerHubGenesisEvent(t, dymension, rollapp1.Config().ChainID, channDymRollApp.ChannelID, dymensionUser.KeyName())

t.Run("multihop rollapp->dym->gaia, funds received on gaia after grace period", func(t *testing.T) {
firstHopDenom := transfertypes.GetPrefixedDenom(channDymRollApp.PortID, channDymRollApp.ChannelID, rollapp1.Config().Denom)
Expand Down
30 changes: 15 additions & 15 deletions tests/ibc_timeout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ import (

"cosmossdk.io/math"
transfertypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"

test "github.com/decentrio/rollup-e2e-testing"
"github.com/decentrio/rollup-e2e-testing/cosmos"
"github.com/decentrio/rollup-e2e-testing/cosmos/hub/dym_hub"
"github.com/decentrio/rollup-e2e-testing/cosmos/rollapp/dym_rollapp"
"github.com/decentrio/rollup-e2e-testing/ibc"

"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"

"github.com/decentrio/rollup-e2e-testing/relayer"
"github.com/decentrio/rollup-e2e-testing/testreporter"
"github.com/decentrio/rollup-e2e-testing/testutil"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"
)

// This test case verifies the system's behavior when an IBC packet sent from the rollapp to the hub times out.
Expand Down Expand Up @@ -158,13 +160,7 @@ func TestIBCTransferTimeout_EVM(t *testing.T) {
channel, err := ibc.GetTransferChannel(ctx, r, eRep, dymension.Config().ChainID, rollapp1.Config().ChainID)
require.NoError(t, err)

err = r.StartRelayer(ctx, eRep, ibcPath)
require.NoError(t, err)
// Wait a few blocks for relayer to start
err = testutil.WaitForBlocks(ctx, 3, dymension, rollapp1)
require.NoError(t, err)

triggerGenesisEvent(t, dymension, rollapp1.GetChainID(), channel.ChannelID, dymensionUser)
triggerHubGenesisEvent(t, dymension, rollapp1.Config().ChainID, channel.ChannelID, dymensionUser.KeyName())

transferData := ibc.WalletData{
Address: dymensionUserAddr,
Expand All @@ -184,6 +180,9 @@ func TestIBCTransferTimeout_EVM(t *testing.T) {
// Assert balance was updated on the rollapp
testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferData.Amount))

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

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

Expand Down Expand Up @@ -380,12 +379,7 @@ func TestIBCTransferTimeout_Wasm(t *testing.T) {
channel, err := ibc.GetTransferChannel(ctx, r, eRep, dymension.Config().ChainID, rollapp1.Config().ChainID)
require.NoError(t, err)

err = r.StartRelayer(ctx, eRep, ibcPath)
require.NoError(t, err)
err = testutil.WaitForBlocks(ctx, 3, dymension)
require.NoError(t, err)

triggerGenesisEvent(t, dymension, rollapp1.GetChainID(), channel.ChannelID, dymensionUser)
triggerHubGenesisEvent(t, dymension, rollapp1.GetChainID(), channel.ChannelID, dymensionUser.KeyName())

transferData := ibc.WalletData{
Address: dymensionUserAddr,
Expand All @@ -405,6 +399,12 @@ func TestIBCTransferTimeout_Wasm(t *testing.T) {
// Assert balance was updated on the rollapp
testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferData.Amount))

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

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

// Stop relayer after relaying
err = r.StopRelayer(ctx, eRep)
require.NoError(t, err, "an error occurred while stopping the relayer")
Expand Down
9 changes: 5 additions & 4 deletions tests/ibc_transfer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ import (

"cosmossdk.io/math"
transfertypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"

test "github.com/decentrio/rollup-e2e-testing"
"github.com/decentrio/rollup-e2e-testing/cosmos/hub/dym_hub"
"github.com/decentrio/rollup-e2e-testing/cosmos/rollapp/dym_rollapp"
"github.com/decentrio/rollup-e2e-testing/ibc"
"github.com/decentrio/rollup-e2e-testing/relayer"
"github.com/decentrio/rollup-e2e-testing/testreporter"
"github.com/decentrio/rollup-e2e-testing/testutil"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"
)

const ibcPath = "dymension-demo"
Expand Down Expand Up @@ -152,7 +153,7 @@ func TestIBCTransferSuccess_EVM(t *testing.T) {
},
)

triggerGenesisEvent(t, dymension, rollapp1.GetChainID(), channel.ChannelID, dymensionUser)
triggerHubGenesisEvent(t, dymension, rollapp1.Config().ChainID, channel.ChannelID, dymensionUser.KeyName())

// Compose an IBC transfer and send from dymension -> rollapp
transferAmount := math.NewInt(1_000_000)
Expand Down Expand Up @@ -336,7 +337,7 @@ func TestIBCTransferSuccess_Wasm(t *testing.T) {
},
)

triggerGenesisEvent(t, dymension, rollapp1.GetChainID(), channel.ChannelID, dymensionUser)
triggerHubGenesisEvent(t, dymension, rollapp1.Config().ChainID, channel.ChannelID, dymensionUser.KeyName())

// Compose an IBC transfer and send from dymension -> rollapp
transferAmount := math.NewInt(1_000_000)
Expand Down
Loading

0 comments on commit 6e612fa

Please sign in to comment.