Skip to content

Commit

Permalink
Feat: Update testing framework (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
GNaD13 authored Feb 27, 2024
1 parent 1c69f93 commit 98f373d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
cosmossdk.io/math v1.0.0-rc.0
github.com/cosmos/cosmos-sdk v0.46.16-0.20231025193730-41d2a21c1348
github.com/cosmos/ibc-go/v6 v6.2.1
github.com/decentrio/rollup-e2e-testing v0.0.0-20240217042554-3b5f78dba876
github.com/decentrio/rollup-e2e-testing v0.0.0-20240226065125-246da844cabf
github.com/evmos/ethermint v0.0.0-00010101000000-000000000000
github.com/stretchr/testify v1.8.4
go.uber.org/zap v1.24.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/decentrio/rollup-e2e-testing v0.0.0-20240217042554-3b5f78dba876 h1:09ApxSVYDJhdkfENKoOOOZDVo9leMbMuLPiEGHdC9TQ=
github.com/decentrio/rollup-e2e-testing v0.0.0-20240217042554-3b5f78dba876/go.mod h1:Hy/8P41OEKrlAatPG5NcD/BOWTa2s+laECwpZpmA9f0=
github.com/decentrio/rollup-e2e-testing v0.0.0-20240226065125-246da844cabf h1:yx8AVPUPphUcQxwxD2OVvJCitiRXr0SxnhNV0BXvoWY=
github.com/decentrio/rollup-e2e-testing v0.0.0-20240226065125-246da844cabf/go.mod h1:Hy/8P41OEKrlAatPG5NcD/BOWTa2s+laECwpZpmA9f0=
github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4=
github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo=
github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0=
Expand Down
16 changes: 8 additions & 8 deletions tests/ibc_timeout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ 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/decentrio/rollup-e2e-testing/relayer"
Expand Down Expand Up @@ -38,11 +39,11 @@ func TestIBCTransferTimeout(t *testing.T) {
numHubFullNodes := 1
numRollAppFn := 0
numRollAppVals := 1
cf := cosmos.NewBuiltinChainFactory(zaptest.NewLogger(t), []*cosmos.ChainSpec{
cf := test.NewBuiltinChainFactory(zaptest.NewLogger(t), []*test.ChainSpec{
{
Name: "rollapp1",
ChainConfig: ibc.ChainConfig{
Type: "rollapp",
Type: "rollapp-dym",
Name: "rollapp-test",
ChainID: "demo-dymension-rollapp",
Images: []ibc.DockerImage{rollappImage},
Expand Down Expand Up @@ -71,18 +72,17 @@ func TestIBCTransferTimeout(t *testing.T) {
chains, err := cf.Chains(t.Name())
require.NoError(t, err)

rollapp1 := chains[0].(*cosmos.CosmosChain)
dymension := chains[1].(*cosmos.CosmosChain)
rollapp1 := chains[0].(*dym_rollapp.DymRollApp)
dymension := chains[1].(*dym_hub.DymHub)

// Relayer Factory
client, network := test.DockerSetup(t)
r := relayer.NewBuiltinRelayerFactory(ibc.CosmosRly, zaptest.NewLogger(t),
r := test.NewBuiltinRelayerFactory(ibc.CosmosRly, zaptest.NewLogger(t),
relayer.CustomDockerImage("ghcr.io/cosmos/relayer", "reece-v2.3.1-ethermint", "100:1000"),
).Build(t, client, network)
const ibcPath = "ibc-path"
ic := test.NewSetup().
AddChain(rollapp1).
AddChain(dymension).
AddRollUp(dymension, rollapp1).
AddRelayer(r, "relayer").
AddLink(test.InterchainLink{
Chain1: dymension,
Expand Down
16 changes: 8 additions & 8 deletions tests/ibc_transfer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import (

"cosmossdk.io/math"
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/decentrio/rollup-e2e-testing/relayer"
"github.com/decentrio/rollup-e2e-testing/testreporter"
Expand Down Expand Up @@ -38,11 +39,11 @@ func TestIBCTransferSuccess(t *testing.T) {
numHubFullNodes := 1
numRollAppFn := 0
numRollAppVals := 1
cf := cosmos.NewBuiltinChainFactory(zaptest.NewLogger(t), []*cosmos.ChainSpec{
cf := test.NewBuiltinChainFactory(zaptest.NewLogger(t), []*test.ChainSpec{
{
Name: "rollapp1",
ChainConfig: ibc.ChainConfig{
Type: "rollapp",
Type: "rollapp-dym",
Name: "rollapp-temp",
ChainID: "demo-dymension-rollapp",
Images: []ibc.DockerImage{rollappImage},
Expand Down Expand Up @@ -72,19 +73,18 @@ func TestIBCTransferSuccess(t *testing.T) {
chains, err := cf.Chains(t.Name())
require.NoError(t, err)

rollapp1 := chains[0].(*cosmos.CosmosChain)
dymension := chains[1].(*cosmos.CosmosChain)
rollapp1 := chains[0].(*dym_rollapp.DymRollApp)
dymension := chains[1].(*dym_hub.DymHub)

// Relayer Factory
client, network := test.DockerSetup(t)

r := relayer.NewBuiltinRelayerFactory(ibc.CosmosRly, zaptest.NewLogger(t),
r := test.NewBuiltinRelayerFactory(ibc.CosmosRly, zaptest.NewLogger(t),
relayer.CustomDockerImage("ghcr.io/cosmos/relayer", "reece-v2.3.1-ethermint", "100:1000"),
).Build(t, client, network)

ic := test.NewSetup().
AddChain(rollapp1).
AddChain(dymension).
AddRollUp(dymension, rollapp1).
AddRelayer(r, "relayer").
AddLink(test.InterchainLink{
Chain1: dymension,
Expand Down
2 changes: 1 addition & 1 deletion tests/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var (
}

dymensionConfig = ibc.ChainConfig{
Type: "hub",
Type: "hub-dym",
Name: "dymension",
ChainID: "dymension_100-1",
Images: []ibc.DockerImage{dymensionImage},
Expand Down

0 comments on commit 98f373d

Please sign in to comment.