From ed74ca601c49664444ec8c4ac65df4d4eebd183a Mon Sep 17 00:00:00 2001 From: anhductn2001 Date: Mon, 26 Aug 2024 14:46:18 +0700 Subject: [PATCH 1/6] init Test_SeqRotation_NoSeq_DA_EVM --- Makefile | 3 + tests/sequencer_rotation_test.go | 300 +++++++++++++++++++++++++++++++ tests/setup.go | 16 +- 3 files changed, 313 insertions(+), 6 deletions(-) create mode 100644 tests/sequencer_rotation_test.go diff --git a/Makefile b/Makefile index bef9b80c..f6d1cc93 100644 --- a/Makefile +++ b/Makefile @@ -242,6 +242,9 @@ e2e-test-fullnode-sync-block-sync-evm: clean-e2e e2e-test-fullnode-disconnect-block-sync-evm: clean-e2e cd tests && go test -timeout=30m -race -v -run TestSync_BlockSync_fn_disconnect_EVM . +e2e-test-sequencer-rotation-noseq-da-evm: clean-e2e + cd tests && go test -timeout=30m -race -v -run Test_SeqRotation_NoSeq_DA_EVM . + # Executes IBC tests via rollup-e2e-testing e2e-test-ibc-success-wasm: clean-e2e cd tests && go test -timeout=45m -race -v -run TestIBCTransferSuccess_Wasm . diff --git a/tests/sequencer_rotation_test.go b/tests/sequencer_rotation_test.go new file mode 100644 index 00000000..2aa4f6c2 --- /dev/null +++ b/tests/sequencer_rotation_test.go @@ -0,0 +1,300 @@ +package tests + +import ( + "context" + "fmt" + "testing" + "time" + + transfertypes "github.com/cosmos/ibc-go/v7/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" +) + +func Test_SeqRotation_NoSeq_DA_EVM(t *testing.T) { + if testing.Short() { + t.Skip() + } + + ctx := context.Background() + + go StartDA() + + // setup config for rollapp 1 + settlement_layer_rollapp1 := "dymension" + settlement_node_address := fmt.Sprintf("http://dymension_100-1-val-0-%s:26657", t.Name()) + rollapp1_id := "rollappevm_1234-1" + gas_price_rollapp1 := "0adym" + maxIdleTime1 := "5s" + maxProofTime := "500ms" + configFileOverrides := overridesDymintToml(settlement_layer_rollapp1, settlement_node_address, rollapp1_id, gas_price_rollapp1, maxIdleTime1, maxProofTime, "20s", false) + + // Create chain factory with dymension + numHubVals := 1 + numHubFullNodes := 1 + numRollAppVals := 1 + numRollAppFn := 0 + + cf := test.NewBuiltinChainFactory(zaptest.NewLogger(t), []*test.ChainSpec{ + { + Name: "rollapp1", + ChainConfig: ibc.ChainConfig{ + Type: "rollapp-dym", + Name: "rollapp-temp", + ChainID: "rollappevm_1234-1", + Images: []ibc.DockerImage{rollappEVMImage}, + Bin: "rollappd", + Bech32Prefix: "ethm", + Denom: "urax", + CoinType: "60", + GasPrices: "0.0urax", + GasAdjustment: 1.1, + TrustingPeriod: "112h", + EncodingConfig: encodingConfig(), + NoHostMount: false, + ModifyGenesis: modifyRollappEVMGenesis(rollappEVMGenesisKV), + ConfigFileOverrides: configFileOverrides, + }, + NumValidators: &numRollAppVals, + NumFullNodes: &numRollAppFn, + }, + { + Name: "dymension-hub", + ChainConfig: dymensionConfig, + NumValidators: &numHubVals, + NumFullNodes: &numHubFullNodes, + }, + }) + + // Get chains from the chain factory + chains, err := cf.Chains(t.Name()) + require.NoError(t, err) + + rollapp1 := chains[0].(*dym_rollapp.DymRollApp) + dymension := chains[1].(*dym_hub.DymHub) + + // Relayer Factory + client, network := test.DockerSetup(t) + + // relayer for rollapp 1 + r := test.NewBuiltinRelayerFactory(ibc.CosmosRly, zaptest.NewLogger(t), + relayer.CustomDockerImage(RelayerMainRepo, relayerVersion, "100:1000"), relayer.ImagePull(pullRelayerImage), + ).Build(t, client, "relayer", network) + + ic := test.NewSetup(). + AddRollUp(dymension, rollapp1). + AddRelayer(r, "relayer"). + AddLink(test.InterchainLink{ + Chain1: dymension, + Chain2: rollapp1, + Relayer: r, + Path: ibcPath, + }) + + rep := testreporter.NewNopReporter() + eRep := rep.RelayerExecReporter(t) + + err = ic.Build(ctx, eRep, test.InterchainBuildOptions{ + TestName: t.Name(), + Client: client, + NetworkID: network, + SkipPathCreation: true, + }, nil, "", nil) + require.NoError(t, err) + + // Check IBC Transfer before switch + CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) + + // Create some user accounts on both chains + users := test.GetAndFundTestUsers(t, ctx, t.Name(), walletAmount, dymension, rollapp1) + + // Get our Bech32 encoded user addresses + dymensionUser, rollappUser := users[0], users[1] + + dymensionUserAddr := dymensionUser.FormattedAddress() + rollappUserAddr := rollappUser.FormattedAddress() + + 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, 10, dymension, rollapp1) + require.NoError(t, err) + + // Send a normal ibc tx from RA -> Hub + transferData := ibc.WalletData{ + Address: dymensionUserAddr, + Denom: rollapp1.Config().Denom, + Amount: transferAmount, + } + + // Compose an IBC transfer and send from rollapp -> Hub + _, err = rollapp1.SendIBCTransfer(ctx, channel.ChannelID, rollappUserAddr, transferData, ibc.TransferOptions{}) + require.NoError(t, err) + + rollappHeight, err := rollapp1.GetNode().Height(ctx) + require.NoError(t, err) + + // Assert balance was updated on the hub + testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferData.Amount)) + + // wait until the packet is finalized + isFinalized, err := dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp1.GetChainID(), rollappHeight, 300) + require.NoError(t, err) + require.True(t, isFinalized) + + // Get the IBC denom for urax on Hub + rollappTokenDenom := transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, rollapp1.Config().Denom) + rollappIBCDenom := transfertypes.ParseDenomTrace(rollappTokenDenom).IBCDenom() + + testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, rollappIBCDenom, transferAmount.Sub(bridgingFee)) + + // Get original account balances + dymensionOrigBal, err := dymension.GetBalance(ctx, dymensionUserAddr, dymension.Config().Denom) + require.NoError(t, err) + + // Compose an IBC transfer and send from dymension -> rollapp + transferData = ibc.WalletData{ + Address: rollappUserAddr, + Denom: dymension.Config().Denom, + Amount: transferAmount, + } + + // Compose an IBC transfer and send from Hub -> rollapp + _, err = dymension.SendIBCTransfer(ctx, channel.ChannelID, dymensionUserAddr, transferData, ibc.TransferOptions{}) + require.NoError(t, err) + + // Assert balance was updated on the hub + testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) + + err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) + require.NoError(t, err) + + // Get the IBC denom + dymensionTokenDenom := transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, dymension.Config().Denom) + dymensionIBCDenom := transfertypes.ParseDenomTrace(dymensionTokenDenom).IBCDenom() + + testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) + erc20MAcc, err := rollapp1.Validators[0].QueryModuleAccount(ctx, "erc20") + require.NoError(t, err) + erc20MAccAddr := erc20MAcc.Account.BaseAccount.Address + testutil.AssertBalance(t, ctx, rollapp1, erc20MAccAddr, dymensionIBCDenom, transferData.Amount) + + // Unbond sequencer1 + err = dymension.Unbond(ctx, rollapp1.GetSequencer(), rollapp1.GetSequencerKeyDir()) + require.NoError(t, err) + + seqAddr, err := dymension.AccountKeyBech32WithKeyDir(ctx, rollapp1.GetSequencer(), rollapp1.GetSequencerKeyDir()) + require.NoError(t, err) + + queryGetSequencerResponse, err := dymension.QueryShowSequencer(ctx, seqAddr) + require.NoError(t, err) + require.Equal(t, queryGetSequencerResponse.Sequencer.Status, "OPERATING_STATUS_UNBONDING") + + err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) + require.NoError(t, err) + + time.Sleep(150 * time.Second) + + // Chain halted + err = testutil.WaitForBlocks(ctx, 5, dymension, rollapp1) + require.Error(t, err) + + lastBlock, err := rollapp1.Height(ctx) + require.NoError(t, err) + + // create 1 more sequencer + _, _, err = rollapp1.GetNode().ExecInit(ctx, "sequencer1", "/var/cosmos-chain/sequencer1") + require.NoError(t, err) + + cmd := append([]string{rollapp1.Validators[0].Chain.Config().Bin}, "dymint", "show-sequencer", "--home", "/var/cosmos-chain/sequencer1") + pub1, _, err := rollapp1.GetNode().Exec(ctx, cmd, nil) + require.NoError(t, err) + + // Create some user accounts on both chains + users = test.GetAndFundTestUsers(t, ctx, t.Name(), walletAmount, dymension) + + // Wait a few blocks for relayer to start and for user accounts to be created + err = testutil.WaitForBlocks(ctx, 5, dymension, rollapp1) + require.NoError(t, err) + + sequencer1 := users[0] + + command := []string{"dymd", "tx", "sequencer", "create-sequencer", string(pub1), rollapp1.Config().ChainID, rollapp1.GetSequencerKeyDir() + "/metadata_sequencer.json", "1000000000adym", + "--broadcast-mode", "async"} + + _, err = dymension.Validators[0].ExecTx(ctx, sequencer1.KeyName(), command...) + require.NoError(t, err) + + res, err := dymension.QueryShowSequencerByRollapp(ctx, rollapp1.Config().ChainID) + require.NoError(t, err) + require.Equal(t, len(res.Sequencers), 2, "should have 2 sequences") + + afterBlock, err := rollapp1.Height(ctx) + require.NoError(t, err) + require.True(t, afterBlock > lastBlock) + + // Compose an IBC transfer and send from rollapp -> Hub + _, err = rollapp1.SendIBCTransfer(ctx, channel.ChannelID, rollappUserAddr, transferData, ibc.TransferOptions{}) + require.NoError(t, err) + + // Check IBC after switch + rollappHeight, err = rollapp1.GetNode().Height(ctx) + require.NoError(t, err) + + // Assert balance was updated on the hub + testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferData.Amount)) + + // wait until the packet is finalized + isFinalized, err = dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp1.GetChainID(), rollappHeight, 300) + require.NoError(t, err) + require.True(t, isFinalized) + + // Get the IBC denom for urax on Hub + rollappTokenDenom = transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, rollapp1.Config().Denom) + rollappIBCDenom = transfertypes.ParseDenomTrace(rollappTokenDenom).IBCDenom() + + testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, rollappIBCDenom, transferAmount.Sub(bridgingFee)) + + // Get original account balances + dymensionOrigBal, err = dymension.GetBalance(ctx, dymensionUserAddr, dymension.Config().Denom) + require.NoError(t, err) + + // Compose an IBC transfer and send from dymension -> rollapp + transferData = ibc.WalletData{ + Address: rollappUserAddr, + Denom: dymension.Config().Denom, + Amount: transferAmount, + } + + // Compose an IBC transfer and send from Hub -> rollapp + _, err = dymension.SendIBCTransfer(ctx, channel.ChannelID, dymensionUserAddr, transferData, ibc.TransferOptions{}) + require.NoError(t, err) + + // Assert balance was updated on the hub + testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) + + err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) + require.NoError(t, err) + + // Get the IBC denom + dymensionTokenDenom = transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, dymension.Config().Denom) + dymensionIBCDenom = transfertypes.ParseDenomTrace(dymensionTokenDenom).IBCDenom() + + testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) + erc20MAcc, err = rollapp1.Validators[0].QueryModuleAccount(ctx, "erc20") + require.NoError(t, err) + erc20MAccAddr = erc20MAcc.Account.BaseAccount.Address + testutil.AssertBalance(t, ctx, rollapp1, erc20MAccAddr, dymensionIBCDenom, transferData.Amount) + +} diff --git a/tests/setup.go b/tests/setup.go index 136079c8..27c4b1e2 100644 --- a/tests/setup.go +++ b/tests/setup.go @@ -84,12 +84,12 @@ type ForwardMetadata struct { } const ( - ibcPath = "dymension-demo" - anotherIbcPath = "dymension-demo2" - BLOCK_FINALITY_PERIOD = 30 - EventDemandOrderCreated = "dymensionxyz.dymension.eibc.EventDemandOrderCreated" - EventDemandOrderFulfilled = "dymensionxyz.dymension.eibc.EventDemandOrderFulfilled" - EventDemandOrderFeeUpdated = "dymensionxyz.dymension.eibc.EventDemandOrderFeeUpdated" + ibcPath = "dymension-demo" + anotherIbcPath = "dymension-demo2" + BLOCK_FINALITY_PERIOD = 30 + EventDemandOrderCreated = "dymensionxyz.dymension.eibc.EventDemandOrderCreated" + EventDemandOrderFulfilled = "dymensionxyz.dymension.eibc.EventDemandOrderFulfilled" + EventDemandOrderFeeUpdated = "dymensionxyz.dymension.eibc.EventDemandOrderFeeUpdated" EventDemandOrderPacketStatusUpdated = "dymensionxyz.dymension.eibc.EventDemandOrderPacketStatusUpdated" ) @@ -291,6 +291,10 @@ var ( } dymensionGenesisKV = []cosmos.GenesisKV{ + { + Key: "app_state.sequencer.params.notice_period", + Value: "180s", + }, // gov params { Key: "app_state.gov.params.voting_period", From b800364bc5f94a6a8dee278f4d6e3854d842b0c2 Mon Sep 17 00:00:00 2001 From: anhductn2001 Date: Tue, 27 Aug 2024 11:34:38 +0700 Subject: [PATCH 2/6] init Test_SeqRotation_NoSeq_P2P_EVM --- go.mod | 2 +- go.sum | 4 +- tests/sequencer_rotation_test.go | 332 +++++++++++++++++++++++++++++++ 3 files changed, 335 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index ca47f619..78553357 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ replace ( require ( github.com/decentrio/e2e-testing-live v0.0.0-20240718080249-ee255229c869 - github.com/decentrio/rollup-e2e-testing v0.0.0-20240823161656-0a0ac2f7308e + github.com/decentrio/rollup-e2e-testing v0.0.0-20240826075000-703ac1665ee8 github.com/dymensionxyz/dymension/v3 v3.1.0-rc03.0.20240717194206-54c0fca5fada github.com/dymensionxyz/dymint v1.2.0-rc01 ) diff --git a/go.sum b/go.sum index a88ce38f..cda67fbc 100644 --- a/go.sum +++ b/go.sum @@ -770,8 +770,8 @@ github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c h1:pFUpOrbxDR github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6UhI8N9EjYm1c2odKpFpAYeR8dsBeM7PtzQhRgxRr9U= github.com/decentrio/e2e-testing-live v0.0.0-20240718080249-ee255229c869 h1:qWpUYGOsrSC+1Vmd2TjhbsSpntvvx9PsX3AoeMunFxc= github.com/decentrio/e2e-testing-live v0.0.0-20240718080249-ee255229c869/go.mod h1:HZNYnPwmSxkwTPjSD5yolauc1Vx1ZzKL4FFMxTq4H5Y= -github.com/decentrio/rollup-e2e-testing v0.0.0-20240823161656-0a0ac2f7308e h1:5AchH93BGkHKulz+A26kvban4FI2erpEeho73p1uero= -github.com/decentrio/rollup-e2e-testing v0.0.0-20240823161656-0a0ac2f7308e/go.mod h1:QmBrZgZplhtgHRWC0Z7LC7TDsKuC8sDyQvZyXXaqw/c= +github.com/decentrio/rollup-e2e-testing v0.0.0-20240826075000-703ac1665ee8 h1:0DDLdwsT5WumK6P3m1rAQxz1GzFqN7+TBHAY8hct9IA= +github.com/decentrio/rollup-e2e-testing v0.0.0-20240826075000-703ac1665ee8/go.mod h1:QmBrZgZplhtgHRWC0Z7LC7TDsKuC8sDyQvZyXXaqw/c= 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/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= diff --git a/tests/sequencer_rotation_test.go b/tests/sequencer_rotation_test.go index 2aa4f6c2..5a3f8426 100644 --- a/tests/sequencer_rotation_test.go +++ b/tests/sequencer_rotation_test.go @@ -1,8 +1,11 @@ package tests import ( + "bufio" "context" "fmt" + "os" + "strings" "testing" "time" @@ -296,5 +299,334 @@ func Test_SeqRotation_NoSeq_DA_EVM(t *testing.T) { require.NoError(t, err) erc20MAccAddr = erc20MAcc.Account.BaseAccount.Address testutil.AssertBalance(t, ctx, rollapp1, erc20MAccAddr, dymensionIBCDenom, transferData.Amount) +} + +func Test_SeqRotation_NoSeq_P2P_EVM(t *testing.T) { + if testing.Short() { + t.Skip() + } + + ctx := context.Background() + + // setup config for rollapp 1 + settlement_layer_rollapp1 := "dymension" + settlement_node_address := fmt.Sprintf("http://dymension_100-1-val-0-%s:26657", t.Name()) + rollapp1_id := "rollappevm_1234-1" + gas_price_rollapp1 := "0adym" + maxIdleTime1 := "5s" + maxProofTime := "500ms" + configFileOverrides := overridesDymintToml(settlement_layer_rollapp1, settlement_node_address, rollapp1_id, gas_price_rollapp1, maxIdleTime1, maxProofTime, "20s", false) + + // Create chain factory with dymension + numHubVals := 1 + numHubFullNodes := 1 + numRollAppVals := 1 + numRollAppFn := 1 + + cf := test.NewBuiltinChainFactory(zaptest.NewLogger(t), []*test.ChainSpec{ + { + Name: "rollapp1", + ChainConfig: ibc.ChainConfig{ + Type: "rollapp-dym", + Name: "rollapp-temp", + ChainID: "rollappevm_1234-1", + Images: []ibc.DockerImage{rollappEVMImage}, + Bin: "rollappd", + Bech32Prefix: "ethm", + Denom: "urax", + CoinType: "60", + GasPrices: "0.0urax", + GasAdjustment: 1.1, + TrustingPeriod: "112h", + EncodingConfig: encodingConfig(), + NoHostMount: false, + ModifyGenesis: modifyRollappEVMGenesis(rollappEVMGenesisKV), + ConfigFileOverrides: configFileOverrides, + }, + NumValidators: &numRollAppVals, + NumFullNodes: &numRollAppFn, + }, + { + Name: "dymension-hub", + ChainConfig: dymensionConfig, + NumValidators: &numHubVals, + NumFullNodes: &numHubFullNodes, + }, + }) + + // Get chains from the chain factory + chains, err := cf.Chains(t.Name()) + require.NoError(t, err) + + rollapp1 := chains[0].(*dym_rollapp.DymRollApp) + dymension := chains[1].(*dym_hub.DymHub) + + // Relayer Factory + client, network := test.DockerSetup(t) + + // relayer for rollapp 1 + r := test.NewBuiltinRelayerFactory(ibc.CosmosRly, zaptest.NewLogger(t), + relayer.CustomDockerImage(RelayerMainRepo, relayerVersion, "100:1000"), relayer.ImagePull(pullRelayerImage), + ).Build(t, client, "relayer", network) + + ic := test.NewSetup(). + AddRollUp(dymension, rollapp1). + AddRelayer(r, "relayer"). + AddLink(test.InterchainLink{ + Chain1: dymension, + Chain2: rollapp1, + Relayer: r, + Path: ibcPath, + }) + + rep := testreporter.NewNopReporter() + eRep := rep.RelayerExecReporter(t) + + err = ic.Build(ctx, eRep, test.InterchainBuildOptions{ + TestName: t.Name(), + Client: client, + NetworkID: network, + SkipPathCreation: true, + }, nil, "", nil) + require.NoError(t, err) + + containerID := fmt.Sprintf("rollappevm_1234-1-val-0-%s", t.Name()) + + // Get the container details + containerJSON, err := client.ContainerInspect(context.Background(), containerID) + require.NoError(t, err) + + // Extract the IP address from the network settings + // If the container is using a custom network, the IP might be under a specific network name + var ipAddress string + for _, network := range containerJSON.NetworkSettings.Networks { + ipAddress = network.IPAddress + break // Assuming we only need the IP from the first network + } + + nodeId, err := rollapp1.Validators[0].GetNodeId(ctx) + require.NoError(t, err) + nodeId = strings.TrimRight(nodeId, "\n") + p2p_bootstrap_node := fmt.Sprintf("/ip4/%s/tcp/26656/p2p/%s", ipAddress, nodeId) + + rollapp1HomeDir := strings.Split(rollapp1.HomeDir(), "/") + rollapp1FolderName := rollapp1HomeDir[len(rollapp1HomeDir)-1] + + file, err := os.Open(fmt.Sprintf("/tmp/%s/config/dymint.toml", rollapp1FolderName)) + require.NoError(t, err) + defer file.Close() + + lines := []string{} + scanner := bufio.NewScanner(file) + for scanner.Scan() { + lines = append(lines, scanner.Text()) + } + + for i, line := range lines { + if strings.HasPrefix(line, "p2p_bootstrap_nodes =") { + lines[i] = fmt.Sprintf("p2p_bootstrap_nodes = \"%s\"", p2p_bootstrap_node) + } + } + + output := strings.Join(lines, "\n") + file, err = os.Create(fmt.Sprintf("/tmp/%s/config/dymint.toml", rollapp1FolderName)) + require.NoError(t, err) + defer file.Close() + + _, err = file.Write([]byte(output)) + require.NoError(t, err) + + // Start full node + err = rollapp1.FullNodes[0].StopContainer(ctx) + require.NoError(t, err) + + err = rollapp1.FullNodes[0].StartContainer(ctx) + require.NoError(t, err) + + // Check IBC Transfer before switch + CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) + + // Create some user accounts on both chains + users := test.GetAndFundTestUsers(t, ctx, t.Name(), walletAmount, dymension, rollapp1) + + // Get our Bech32 encoded user addresses + dymensionUser, rollappUser := users[0], users[1] + + dymensionUserAddr := dymensionUser.FormattedAddress() + rollappUserAddr := rollappUser.FormattedAddress() + + 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, 10, dymension, rollapp1) + require.NoError(t, err) + + // Send a normal ibc tx from RA -> Hub + transferData := ibc.WalletData{ + Address: dymensionUserAddr, + Denom: rollapp1.Config().Denom, + Amount: transferAmount, + } + + // Compose an IBC transfer and send from rollapp -> Hub + _, err = rollapp1.SendIBCTransfer(ctx, channel.ChannelID, rollappUserAddr, transferData, ibc.TransferOptions{}) + require.NoError(t, err) + + rollappHeight, err := rollapp1.GetNode().Height(ctx) + require.NoError(t, err) + + // Assert balance was updated on the hub + testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferData.Amount)) + // wait until the packet is finalized + isFinalized, err := dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp1.GetChainID(), rollappHeight, 300) + require.NoError(t, err) + require.True(t, isFinalized) + + // Get the IBC denom for urax on Hub + rollappTokenDenom := transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, rollapp1.Config().Denom) + rollappIBCDenom := transfertypes.ParseDenomTrace(rollappTokenDenom).IBCDenom() + + testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, rollappIBCDenom, transferAmount.Sub(bridgingFee)) + + // Get original account balances + dymensionOrigBal, err := dymension.GetBalance(ctx, dymensionUserAddr, dymension.Config().Denom) + require.NoError(t, err) + + // Compose an IBC transfer and send from dymension -> rollapp + transferData = ibc.WalletData{ + Address: rollappUserAddr, + Denom: dymension.Config().Denom, + Amount: transferAmount, + } + + // Compose an IBC transfer and send from Hub -> rollapp + _, err = dymension.SendIBCTransfer(ctx, channel.ChannelID, dymensionUserAddr, transferData, ibc.TransferOptions{}) + require.NoError(t, err) + + // Assert balance was updated on the hub + testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) + + err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) + require.NoError(t, err) + + // Get the IBC denom + dymensionTokenDenom := transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, dymension.Config().Denom) + dymensionIBCDenom := transfertypes.ParseDenomTrace(dymensionTokenDenom).IBCDenom() + + testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) + erc20MAcc, err := rollapp1.Validators[0].QueryModuleAccount(ctx, "erc20") + require.NoError(t, err) + erc20MAccAddr := erc20MAcc.Account.BaseAccount.Address + testutil.AssertBalance(t, ctx, rollapp1, erc20MAccAddr, dymensionIBCDenom, transferData.Amount) + + // Unbond sequencer1 + err = dymension.Unbond(ctx, rollapp1.GetSequencer(), rollapp1.GetSequencerKeyDir()) + require.NoError(t, err) + + seqAddr, err := dymension.AccountKeyBech32WithKeyDir(ctx, rollapp1.GetSequencer(), rollapp1.GetSequencerKeyDir()) + require.NoError(t, err) + + queryGetSequencerResponse, err := dymension.QueryShowSequencer(ctx, seqAddr) + require.NoError(t, err) + require.Equal(t, queryGetSequencerResponse.Sequencer.Status, "OPERATING_STATUS_UNBONDING") + + err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) + require.NoError(t, err) + + time.Sleep(150 * time.Second) + + // Chain halted + err = testutil.WaitForBlocks(ctx, 5, dymension, rollapp1) + require.Error(t, err) + + lastBlock, err := rollapp1.Height(ctx) + require.NoError(t, err) + + // create 1 more sequencer + _, _, err = rollapp1.GetNode().ExecInit(ctx, "sequencer1", "/var/cosmos-chain/sequencer1") + require.NoError(t, err) + + cmd := append([]string{rollapp1.Validators[0].Chain.Config().Bin}, "dymint", "show-sequencer", "--home", "/var/cosmos-chain/sequencer1") + pub1, _, err := rollapp1.GetNode().Exec(ctx, cmd, nil) + require.NoError(t, err) + + // Create some user accounts on both chains + users = test.GetAndFundTestUsers(t, ctx, t.Name(), walletAmount, dymension) + + // Wait a few blocks for relayer to start and for user accounts to be created + err = testutil.WaitForBlocks(ctx, 5, dymension, rollapp1) + require.NoError(t, err) + + sequencer1 := users[0] + + command := []string{"dymd", "tx", "sequencer", "create-sequencer", string(pub1), rollapp1.Config().ChainID, rollapp1.GetSequencerKeyDir() + "/metadata_sequencer.json", "1000000000adym", + "--broadcast-mode", "async"} + + _, err = dymension.Validators[0].ExecTx(ctx, sequencer1.KeyName(), command...) + require.NoError(t, err) + + res, err := dymension.QueryShowSequencerByRollapp(ctx, rollapp1.Config().ChainID) + require.NoError(t, err) + require.Equal(t, len(res.Sequencers), 2, "should have 2 sequences") + + afterBlock, err := rollapp1.Height(ctx) + require.NoError(t, err) + require.True(t, afterBlock > lastBlock) + + // Compose an IBC transfer and send from rollapp -> Hub + _, err = rollapp1.SendIBCTransfer(ctx, channel.ChannelID, rollappUserAddr, transferData, ibc.TransferOptions{}) + require.NoError(t, err) + + // Check IBC after switch + rollappHeight, err = rollapp1.GetNode().Height(ctx) + require.NoError(t, err) + + // Assert balance was updated on the hub + testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferData.Amount)) + + // wait until the packet is finalized + isFinalized, err = dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp1.GetChainID(), rollappHeight, 300) + require.NoError(t, err) + require.True(t, isFinalized) + + // Get the IBC denom for urax on Hub + rollappTokenDenom = transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, rollapp1.Config().Denom) + rollappIBCDenom = transfertypes.ParseDenomTrace(rollappTokenDenom).IBCDenom() + + testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, rollappIBCDenom, transferAmount.Sub(bridgingFee)) + + // Get original account balances + dymensionOrigBal, err = dymension.GetBalance(ctx, dymensionUserAddr, dymension.Config().Denom) + require.NoError(t, err) + + // Compose an IBC transfer and send from dymension -> rollapp + transferData = ibc.WalletData{ + Address: rollappUserAddr, + Denom: dymension.Config().Denom, + Amount: transferAmount, + } + + // Compose an IBC transfer and send from Hub -> rollapp + _, err = dymension.SendIBCTransfer(ctx, channel.ChannelID, dymensionUserAddr, transferData, ibc.TransferOptions{}) + require.NoError(t, err) + + // Assert balance was updated on the hub + testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) + + err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) + require.NoError(t, err) + + // Get the IBC denom + dymensionTokenDenom = transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, dymension.Config().Denom) + dymensionIBCDenom = transfertypes.ParseDenomTrace(dymensionTokenDenom).IBCDenom() + + testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) + erc20MAcc, err = rollapp1.Validators[0].QueryModuleAccount(ctx, "erc20") + require.NoError(t, err) + erc20MAccAddr = erc20MAcc.Account.BaseAccount.Address + testutil.AssertBalance(t, ctx, rollapp1, erc20MAccAddr, dymensionIBCDenom, transferData.Amount) } From 5ea28b31144339ecf0f0fd561d3ebd3925c36263 Mon Sep 17 00:00:00 2001 From: anhductn2001 Date: Fri, 30 Aug 2024 15:00:23 +0700 Subject: [PATCH 3/6] tmp --- Makefile | 3 + go.mod | 2 +- go.sum | 4 +- tests/sequencer_rotation_test.go | 214 ++++++++++++++++--------------- 4 files changed, 115 insertions(+), 108 deletions(-) diff --git a/Makefile b/Makefile index f6d1cc93..053293e8 100644 --- a/Makefile +++ b/Makefile @@ -245,6 +245,9 @@ e2e-test-fullnode-disconnect-block-sync-evm: clean-e2e e2e-test-sequencer-rotation-noseq-da-evm: clean-e2e cd tests && go test -timeout=30m -race -v -run Test_SeqRotation_NoSeq_DA_EVM . +e2e-test-sequencer-rotation-noseq-p2p-evm: clean-e2e + cd tests && go test -timeout=30m -race -v -run Test_SeqRotation_NoSeq_P2P_EVM . + # Executes IBC tests via rollup-e2e-testing e2e-test-ibc-success-wasm: clean-e2e cd tests && go test -timeout=45m -race -v -run TestIBCTransferSuccess_Wasm . diff --git a/go.mod b/go.mod index 78553357..77b2c5cc 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ replace ( require ( github.com/decentrio/e2e-testing-live v0.0.0-20240718080249-ee255229c869 - github.com/decentrio/rollup-e2e-testing v0.0.0-20240826075000-703ac1665ee8 + github.com/decentrio/rollup-e2e-testing v0.0.0-20240828080718-58f7f73bcb53 github.com/dymensionxyz/dymension/v3 v3.1.0-rc03.0.20240717194206-54c0fca5fada github.com/dymensionxyz/dymint v1.2.0-rc01 ) diff --git a/go.sum b/go.sum index cda67fbc..7e845d4a 100644 --- a/go.sum +++ b/go.sum @@ -770,8 +770,8 @@ github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c h1:pFUpOrbxDR github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6UhI8N9EjYm1c2odKpFpAYeR8dsBeM7PtzQhRgxRr9U= github.com/decentrio/e2e-testing-live v0.0.0-20240718080249-ee255229c869 h1:qWpUYGOsrSC+1Vmd2TjhbsSpntvvx9PsX3AoeMunFxc= github.com/decentrio/e2e-testing-live v0.0.0-20240718080249-ee255229c869/go.mod h1:HZNYnPwmSxkwTPjSD5yolauc1Vx1ZzKL4FFMxTq4H5Y= -github.com/decentrio/rollup-e2e-testing v0.0.0-20240826075000-703ac1665ee8 h1:0DDLdwsT5WumK6P3m1rAQxz1GzFqN7+TBHAY8hct9IA= -github.com/decentrio/rollup-e2e-testing v0.0.0-20240826075000-703ac1665ee8/go.mod h1:QmBrZgZplhtgHRWC0Z7LC7TDsKuC8sDyQvZyXXaqw/c= +github.com/decentrio/rollup-e2e-testing v0.0.0-20240828080718-58f7f73bcb53 h1:PyDzL3giZuxrUOmSb+qtx4lUQHD0a9vw5ITbWaPrO8w= +github.com/decentrio/rollup-e2e-testing v0.0.0-20240828080718-58f7f73bcb53/go.mod h1:QmBrZgZplhtgHRWC0Z7LC7TDsKuC8sDyQvZyXXaqw/c= 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/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= diff --git a/tests/sequencer_rotation_test.go b/tests/sequencer_rotation_test.go index 5a3f8426..f52ab535 100644 --- a/tests/sequencer_rotation_test.go +++ b/tests/sequencer_rotation_test.go @@ -36,7 +36,7 @@ func Test_SeqRotation_NoSeq_DA_EVM(t *testing.T) { settlement_node_address := fmt.Sprintf("http://dymension_100-1-val-0-%s:26657", t.Name()) rollapp1_id := "rollappevm_1234-1" gas_price_rollapp1 := "0adym" - maxIdleTime1 := "5s" + maxIdleTime1 := "3s" maxProofTime := "500ms" configFileOverrides := overridesDymintToml(settlement_layer_rollapp1, settlement_node_address, rollapp1_id, gas_price_rollapp1, maxIdleTime1, maxProofTime, "20s", false) @@ -113,106 +113,110 @@ func Test_SeqRotation_NoSeq_DA_EVM(t *testing.T) { }, nil, "", nil) require.NoError(t, err) - // Check IBC Transfer before switch - CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) + // // Check IBC Transfer before switch + // CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) - // Create some user accounts on both chains - users := test.GetAndFundTestUsers(t, ctx, t.Name(), walletAmount, dymension, rollapp1) + // // Create some user accounts on both chains + // users := test.GetAndFundTestUsers(t, ctx, t.Name(), walletAmount, dymension, rollapp1) - // Get our Bech32 encoded user addresses - dymensionUser, rollappUser := users[0], users[1] + // // Get our Bech32 encoded user addresses + // dymensionUser, rollappUser := users[0], users[1] - dymensionUserAddr := dymensionUser.FormattedAddress() - rollappUserAddr := rollappUser.FormattedAddress() + // dymensionUserAddr := dymensionUser.FormattedAddress() + // rollappUserAddr := rollappUser.FormattedAddress() - channel, err := ibc.GetTransferChannel(ctx, r, eRep, dymension.Config().ChainID, rollapp1.Config().ChainID) - require.NoError(t, err) + // 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 = r.StartRelayer(ctx, eRep, ibcPath) + // require.NoError(t, err) - err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) - require.NoError(t, err) + // err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) + // require.NoError(t, err) - // Send a normal ibc tx from RA -> Hub - transferData := ibc.WalletData{ - Address: dymensionUserAddr, - Denom: rollapp1.Config().Denom, - Amount: transferAmount, - } + // // Send a normal ibc tx from RA -> Hub + // transferData := ibc.WalletData{ + // Address: dymensionUserAddr, + // Denom: rollapp1.Config().Denom, + // Amount: transferAmount, + // } - // Compose an IBC transfer and send from rollapp -> Hub - _, err = rollapp1.SendIBCTransfer(ctx, channel.ChannelID, rollappUserAddr, transferData, ibc.TransferOptions{}) - require.NoError(t, err) + // // Compose an IBC transfer and send from rollapp -> Hub + // _, err = rollapp1.SendIBCTransfer(ctx, channel.ChannelID, rollappUserAddr, transferData, ibc.TransferOptions{}) + // require.NoError(t, err) - rollappHeight, err := rollapp1.GetNode().Height(ctx) - require.NoError(t, err) + // rollappHeight, err := rollapp1.GetNode().Height(ctx) + // require.NoError(t, err) - // Assert balance was updated on the hub - testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferData.Amount)) + // // Assert balance was updated on the hub + // testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferData.Amount)) - // wait until the packet is finalized - isFinalized, err := dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp1.GetChainID(), rollappHeight, 300) - require.NoError(t, err) - require.True(t, isFinalized) + // // wait until the packet is finalized + // isFinalized, err := dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp1.GetChainID(), rollappHeight, 300) + // require.NoError(t, err) + // require.True(t, isFinalized) - // Get the IBC denom for urax on Hub - rollappTokenDenom := transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, rollapp1.Config().Denom) - rollappIBCDenom := transfertypes.ParseDenomTrace(rollappTokenDenom).IBCDenom() + // // Get the IBC denom for urax on Hub + // rollappTokenDenom := transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, rollapp1.Config().Denom) + // rollappIBCDenom := transfertypes.ParseDenomTrace(rollappTokenDenom).IBCDenom() - testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, rollappIBCDenom, transferAmount.Sub(bridgingFee)) + // testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, rollappIBCDenom, transferAmount.Sub(bridgingFee)) - // Get original account balances - dymensionOrigBal, err := dymension.GetBalance(ctx, dymensionUserAddr, dymension.Config().Denom) - require.NoError(t, err) + // // Get original account balances + // dymensionOrigBal, err := dymension.GetBalance(ctx, dymensionUserAddr, dymension.Config().Denom) + // require.NoError(t, err) - // Compose an IBC transfer and send from dymension -> rollapp - transferData = ibc.WalletData{ - Address: rollappUserAddr, - Denom: dymension.Config().Denom, - Amount: transferAmount, - } + // // Compose an IBC transfer and send from dymension -> rollapp + // transferData = ibc.WalletData{ + // Address: rollappUserAddr, + // Denom: dymension.Config().Denom, + // Amount: transferAmount, + // } - // Compose an IBC transfer and send from Hub -> rollapp - _, err = dymension.SendIBCTransfer(ctx, channel.ChannelID, dymensionUserAddr, transferData, ibc.TransferOptions{}) - require.NoError(t, err) + // // Compose an IBC transfer and send from Hub -> rollapp + // _, err = dymension.SendIBCTransfer(ctx, channel.ChannelID, dymensionUserAddr, transferData, ibc.TransferOptions{}) + // require.NoError(t, err) - // Assert balance was updated on the hub - testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) + // // Assert balance was updated on the hub + // testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) - err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) - require.NoError(t, err) + // err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) + // require.NoError(t, err) - // Get the IBC denom - dymensionTokenDenom := transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, dymension.Config().Denom) - dymensionIBCDenom := transfertypes.ParseDenomTrace(dymensionTokenDenom).IBCDenom() + // // Get the IBC denom + // dymensionTokenDenom := transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, dymension.Config().Denom) + // dymensionIBCDenom := transfertypes.ParseDenomTrace(dymensionTokenDenom).IBCDenom() - testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) - erc20MAcc, err := rollapp1.Validators[0].QueryModuleAccount(ctx, "erc20") - require.NoError(t, err) - erc20MAccAddr := erc20MAcc.Account.BaseAccount.Address - testutil.AssertBalance(t, ctx, rollapp1, erc20MAccAddr, dymensionIBCDenom, transferData.Amount) + // testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) + // erc20MAcc, err := rollapp1.Validators[0].QueryModuleAccount(ctx, "erc20") + // require.NoError(t, err) + // erc20MAccAddr := erc20MAcc.Account.BaseAccount.Address + // testutil.AssertBalance(t, ctx, rollapp1, erc20MAccAddr, dymensionIBCDenom, transferData.Amount) // Unbond sequencer1 - err = dymension.Unbond(ctx, rollapp1.GetSequencer(), rollapp1.GetSequencerKeyDir()) + err = dymension.Unbond(ctx, "sequencer", rollapp1.GetSequencerKeyDir()) require.NoError(t, err) - seqAddr, err := dymension.AccountKeyBech32WithKeyDir(ctx, rollapp1.GetSequencer(), rollapp1.GetSequencerKeyDir()) + seqAddr, err := dymension.AccountKeyBech32WithKeyDir(ctx, "sequencer", rollapp1.GetSequencerKeyDir()) require.NoError(t, err) queryGetSequencerResponse, err := dymension.QueryShowSequencer(ctx, seqAddr) require.NoError(t, err) - require.Equal(t, queryGetSequencerResponse.Sequencer.Status, "OPERATING_STATUS_UNBONDING") + require.Equal(t, "OPERATING_STATUS_BONDED", queryGetSequencerResponse.Sequencer.Status) err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) require.NoError(t, err) - time.Sleep(150 * time.Second) + time.Sleep(180 * time.Second) // Chain halted err = testutil.WaitForBlocks(ctx, 5, dymension, rollapp1) require.Error(t, err) + queryGetSequencerResponse, err = dymension.QueryShowSequencer(ctx, seqAddr) + require.NoError(t, err) + require.Equal(t, "OPERATING_STATUS_UNBONDING", queryGetSequencerResponse.Sequencer.Status) + lastBlock, err := rollapp1.Height(ctx) require.NoError(t, err) @@ -225,7 +229,7 @@ func Test_SeqRotation_NoSeq_DA_EVM(t *testing.T) { require.NoError(t, err) // Create some user accounts on both chains - users = test.GetAndFundTestUsers(t, ctx, t.Name(), walletAmount, dymension) + users := test.GetAndFundTestUsers(t, ctx, t.Name(), walletAmount, dymension) // Wait a few blocks for relayer to start and for user accounts to be created err = testutil.WaitForBlocks(ctx, 5, dymension, rollapp1) @@ -247,58 +251,58 @@ func Test_SeqRotation_NoSeq_DA_EVM(t *testing.T) { require.NoError(t, err) require.True(t, afterBlock > lastBlock) - // Compose an IBC transfer and send from rollapp -> Hub - _, err = rollapp1.SendIBCTransfer(ctx, channel.ChannelID, rollappUserAddr, transferData, ibc.TransferOptions{}) - require.NoError(t, err) + // // Compose an IBC transfer and send from rollapp -> Hub + // _, err = rollapp1.SendIBCTransfer(ctx, channel.ChannelID, rollappUserAddr, transferData, ibc.TransferOptions{}) + // require.NoError(t, err) - // Check IBC after switch - rollappHeight, err = rollapp1.GetNode().Height(ctx) - require.NoError(t, err) + // // Check IBC after switch + // rollappHeight, err = rollapp1.GetNode().Height(ctx) + // require.NoError(t, err) - // Assert balance was updated on the hub - testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferData.Amount)) + // // Assert balance was updated on the hub + // testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferData.Amount)) - // wait until the packet is finalized - isFinalized, err = dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp1.GetChainID(), rollappHeight, 300) - require.NoError(t, err) - require.True(t, isFinalized) + // // wait until the packet is finalized + // isFinalized, err = dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp1.GetChainID(), rollappHeight, 300) + // require.NoError(t, err) + // require.True(t, isFinalized) - // Get the IBC denom for urax on Hub - rollappTokenDenom = transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, rollapp1.Config().Denom) - rollappIBCDenom = transfertypes.ParseDenomTrace(rollappTokenDenom).IBCDenom() + // // Get the IBC denom for urax on Hub + // rollappTokenDenom = transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, rollapp1.Config().Denom) + // rollappIBCDenom = transfertypes.ParseDenomTrace(rollappTokenDenom).IBCDenom() - testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, rollappIBCDenom, transferAmount.Sub(bridgingFee)) + // testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, rollappIBCDenom, transferAmount.Sub(bridgingFee)) - // Get original account balances - dymensionOrigBal, err = dymension.GetBalance(ctx, dymensionUserAddr, dymension.Config().Denom) - require.NoError(t, err) + // // Get original account balances + // dymensionOrigBal, err = dymension.GetBalance(ctx, dymensionUserAddr, dymension.Config().Denom) + // require.NoError(t, err) - // Compose an IBC transfer and send from dymension -> rollapp - transferData = ibc.WalletData{ - Address: rollappUserAddr, - Denom: dymension.Config().Denom, - Amount: transferAmount, - } + // // Compose an IBC transfer and send from dymension -> rollapp + // transferData = ibc.WalletData{ + // Address: rollappUserAddr, + // Denom: dymension.Config().Denom, + // Amount: transferAmount, + // } - // Compose an IBC transfer and send from Hub -> rollapp - _, err = dymension.SendIBCTransfer(ctx, channel.ChannelID, dymensionUserAddr, transferData, ibc.TransferOptions{}) - require.NoError(t, err) + // // Compose an IBC transfer and send from Hub -> rollapp + // _, err = dymension.SendIBCTransfer(ctx, channel.ChannelID, dymensionUserAddr, transferData, ibc.TransferOptions{}) + // require.NoError(t, err) - // Assert balance was updated on the hub - testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) + // // Assert balance was updated on the hub + // testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) - err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) - require.NoError(t, err) + // err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) + // require.NoError(t, err) - // Get the IBC denom - dymensionTokenDenom = transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, dymension.Config().Denom) - dymensionIBCDenom = transfertypes.ParseDenomTrace(dymensionTokenDenom).IBCDenom() + // // Get the IBC denom + // dymensionTokenDenom = transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, dymension.Config().Denom) + // dymensionIBCDenom = transfertypes.ParseDenomTrace(dymensionTokenDenom).IBCDenom() - testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) - erc20MAcc, err = rollapp1.Validators[0].QueryModuleAccount(ctx, "erc20") - require.NoError(t, err) - erc20MAccAddr = erc20MAcc.Account.BaseAccount.Address - testutil.AssertBalance(t, ctx, rollapp1, erc20MAccAddr, dymensionIBCDenom, transferData.Amount) + // testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) + // erc20MAcc, err = rollapp1.Validators[0].QueryModuleAccount(ctx, "erc20") + // require.NoError(t, err) + // erc20MAccAddr = erc20MAcc.Account.BaseAccount.Address + // testutil.AssertBalance(t, ctx, rollapp1, erc20MAccAddr, dymensionIBCDenom, transferData.Amount) } func Test_SeqRotation_NoSeq_P2P_EVM(t *testing.T) { From 296036b8e5c0a7972ba6facfcb44c93065fd3025 Mon Sep 17 00:00:00 2001 From: anhductn2001 Date: Mon, 23 Sep 2024 14:40:57 +0700 Subject: [PATCH 4/6] trusting_period and fail_expected --- clean.sh | 1 + go.mod | 2 +- go.sum | 4 +- tests/admc_test.go | 16 +- tests/automated_denommetadata_test.go | 12 +- tests/bridging_fee_test.go | 4 +- tests/disconnection_test.go | 4 +- tests/eibc_ack_error_test.go | 12 +- tests/eibc_corrupted_memo_test.go | 2 +- tests/eibc_fee_market_test.go | 8 +- tests/eibc_fee_test.go | 2 +- tests/eibc_feemarket_test.go | 16 +- tests/eibc_fulfillment_test.go | 18 +- tests/eibc_invariant_test.go | 4 +- tests/eibc_nobalance_test.go | 2 +- tests/eibc_not_fulfillment_test.go | 4 +- tests/eibc_pfm_test.go | 4 +- tests/eibc_timeout_test.go | 6 +- tests/erc20_ibc_transfer_test.go | 4 +- tests/frozen_test.go | 28 +-- tests/fullnode_sync_block_sync_test.go | 14 +- tests/fullnode_sync_gossip_test.go | 33 +-- tests/fullnode_sync_test.go | 23 +- tests/hardfork_test.go | 12 +- tests/ibc_finalize_block_test.go | 12 +- tests/ibc_grace_period_test.go | 12 +- tests/ibc_timeout_test.go | 4 +- tests/ibc_transfer_test.go | 10 +- tests/rollapp_invariant_test.go | 4 +- tests/rollapp_upgrade_test.go | 8 +- tests/sequencer_invariant_test.go | 4 +- tests/sequencer_rotation_test.go | 296 +++++++++++++++---------- tests/sequencer_test.go | 8 +- tests/tx_batch_finalization_test.go | 4 +- tests/upgrade_hub_test.go | 2 +- 35 files changed, 338 insertions(+), 261 deletions(-) diff --git a/clean.sh b/clean.sh index 56ad5a37..0f5164a8 100644 --- a/clean.sh +++ b/clean.sh @@ -6,5 +6,6 @@ rm -rf /tmp/dym* rm -rf /tmp/sequencer* rm -rf /tmp/celes* rm -rf /tmp/gaia* +rm -rf /tmp/new_rollapp* echo "Clean success!!" diff --git a/go.mod b/go.mod index 51d542ee..52b4283b 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ replace ( require ( github.com/decentrio/e2e-testing-live v0.0.0-20240718080249-ee255229c869 - github.com/decentrio/rollup-e2e-testing v0.0.0-20240919024619-0f39bd77d29b + github.com/decentrio/rollup-e2e-testing v0.0.0-20240923073446-c62503e5e95f github.com/dymensionxyz/dymension/v3 v3.1.0-rc03.0.20240911123104-4782bc4e587f github.com/dymensionxyz/dymint v1.2.0-rc01 ) diff --git a/go.sum b/go.sum index 35958d19..c892d533 100644 --- a/go.sum +++ b/go.sum @@ -770,8 +770,8 @@ github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c h1:pFUpOrbxDR github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6UhI8N9EjYm1c2odKpFpAYeR8dsBeM7PtzQhRgxRr9U= github.com/decentrio/e2e-testing-live v0.0.0-20240718080249-ee255229c869 h1:qWpUYGOsrSC+1Vmd2TjhbsSpntvvx9PsX3AoeMunFxc= github.com/decentrio/e2e-testing-live v0.0.0-20240718080249-ee255229c869/go.mod h1:HZNYnPwmSxkwTPjSD5yolauc1Vx1ZzKL4FFMxTq4H5Y= -github.com/decentrio/rollup-e2e-testing v0.0.0-20240919024619-0f39bd77d29b h1:nbWJnJo1ZDXqplqgQAkBJYIFE6+9eEfHeNFpMa46sZw= -github.com/decentrio/rollup-e2e-testing v0.0.0-20240919024619-0f39bd77d29b/go.mod h1:QmBrZgZplhtgHRWC0Z7LC7TDsKuC8sDyQvZyXXaqw/c= +github.com/decentrio/rollup-e2e-testing v0.0.0-20240923073446-c62503e5e95f h1:YH0RDGXosZHVaxFJ+Q4Kh0782yQq5ZcK5jQNN/RQUgU= +github.com/decentrio/rollup-e2e-testing v0.0.0-20240923073446-c62503e5e95f/go.mod h1:QmBrZgZplhtgHRWC0Z7LC7TDsKuC8sDyQvZyXXaqw/c= 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/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= diff --git a/tests/admc_test.go b/tests/admc_test.go index 0144cd57..928b12bf 100644 --- a/tests/admc_test.go +++ b/tests/admc_test.go @@ -110,7 +110,7 @@ func TestADMC_Originates_HubtoRA_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -279,7 +279,7 @@ func TestADMC_Migrate_Empty_User_Memo_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -507,7 +507,7 @@ func TestADMC_Migrate_With_User_Memo_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -743,7 +743,7 @@ func TestADMC_Originates_HubtoRA_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -912,7 +912,7 @@ func TestADMC_Migrate_Empty_User_Memo_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -1137,7 +1137,7 @@ func TestADMC_Migrate_With_User_Memo_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -1396,7 +1396,7 @@ func TestADMC_MetaData_NotFound_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -1595,7 +1595,7 @@ func TestADMC_MetaData_NotFound_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) diff --git a/tests/automated_denommetadata_test.go b/tests/automated_denommetadata_test.go index 99cfb964..0e1e1d61 100644 --- a/tests/automated_denommetadata_test.go +++ b/tests/automated_denommetadata_test.go @@ -174,7 +174,7 @@ func TestADMC_Hub_to_RA_reserved_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -452,7 +452,7 @@ func TestADMC_Hub_to_RA_3rd_Party_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -741,7 +741,7 @@ func TestADMC_Hub_to_RA_reserved_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -1059,7 +1059,7 @@ func TestADMC_Hub_to_RA_3rd_Party_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -1307,7 +1307,7 @@ func TestADMC_Hub_to_RA_Migrate_Dym_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -1504,7 +1504,7 @@ func TestADMC_Hub_to_RA_Migrate_Dym_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) diff --git a/tests/bridging_fee_test.go b/tests/bridging_fee_test.go index f7a2fe4c..33d2f06b 100644 --- a/tests/bridging_fee_test.go +++ b/tests/bridging_fee_test.go @@ -85,7 +85,7 @@ func Test_Non_Rollappchain_Unaffected_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, gaia1, ibcPath) @@ -305,7 +305,7 @@ func TestChangeBridgeFeeParam_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) diff --git a/tests/disconnection_test.go b/tests/disconnection_test.go index 4abcd5e0..c1c71d73 100644 --- a/tests/disconnection_test.go +++ b/tests/disconnection_test.go @@ -191,7 +191,7 @@ func TestDisconnection_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) // Wait for rollapp finalized @@ -321,7 +321,7 @@ func TestDisconnection_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) // Wait for rollapp finalized diff --git a/tests/eibc_ack_error_test.go b/tests/eibc_ack_error_test.go index e31241a7..d1ac38a2 100644 --- a/tests/eibc_ack_error_test.go +++ b/tests/eibc_ack_error_test.go @@ -169,7 +169,7 @@ func TestEIBC_AckError_Dym_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -579,7 +579,7 @@ func TestEIBC_AckError_RA_Token_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -960,7 +960,7 @@ func TestEIBC_AckError_3rd_Party_Token_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -1414,7 +1414,7 @@ func TestEIBC_AckError_Dym_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -1811,7 +1811,7 @@ func TestEIBC_AckError_RA_Token_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -2190,7 +2190,7 @@ func TestEIBC_AckError_3rd_Party_Token_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) diff --git a/tests/eibc_corrupted_memo_test.go b/tests/eibc_corrupted_memo_test.go index e913770f..1bfa180e 100644 --- a/tests/eibc_corrupted_memo_test.go +++ b/tests/eibc_corrupted_memo_test.go @@ -127,7 +127,7 @@ func TestEIBCCorruptedMemoNegative_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) diff --git a/tests/eibc_fee_market_test.go b/tests/eibc_fee_market_test.go index a2880e45..b93747c1 100644 --- a/tests/eibc_fee_market_test.go +++ b/tests/eibc_fee_market_test.go @@ -151,7 +151,7 @@ func TestEIBCFulfillAlreadyFulfilledDemand_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -468,7 +468,7 @@ func TestEIBCAlreadyFulfilledDemand_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -784,7 +784,7 @@ func TestEIBCUnallowedSigner_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -1046,7 +1046,7 @@ func TestEIBCUnallowedSigner_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) diff --git a/tests/eibc_fee_test.go b/tests/eibc_fee_test.go index b2e817c0..4c9ac999 100644 --- a/tests/eibc_fee_test.go +++ b/tests/eibc_fee_test.go @@ -127,7 +127,7 @@ func TestEIBCFeeTooHigh_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) diff --git a/tests/eibc_feemarket_test.go b/tests/eibc_feemarket_test.go index a4375184..a3bc03ab 100644 --- a/tests/eibc_feemarket_test.go +++ b/tests/eibc_feemarket_test.go @@ -163,7 +163,7 @@ func TestEIBC_Fee_Market_Success_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -454,7 +454,7 @@ func TestEIBC_Fee_Market_Success_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -759,7 +759,7 @@ func TestEIBC_Fee_Market_Auto_Created_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -1047,7 +1047,7 @@ func TestEIBC_Fee_Market_Auto_Created_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -1304,7 +1304,7 @@ func TestEIBCUpdateOnAckErrAndTimeout_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -1552,7 +1552,7 @@ func TestEIBCUpdateOnAckErrAndTimeout_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -1807,7 +1807,7 @@ func TestEIBCUpdateOnTimeout_Unallowed_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -2030,7 +2030,7 @@ func TestEIBCUpdateOnTimeout_Unallowed_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) diff --git a/tests/eibc_fulfillment_test.go b/tests/eibc_fulfillment_test.go index 59aba82b..920cfe7d 100644 --- a/tests/eibc_fulfillment_test.go +++ b/tests/eibc_fulfillment_test.go @@ -168,7 +168,7 @@ func TestEIBCFulfillOnOneRollApp_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -549,7 +549,7 @@ func TestEIBCFulfillOnOneRollApp_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -934,7 +934,7 @@ func TestEIBCFulfillment_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -1220,7 +1220,7 @@ func TestEIBCFulfillment_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -1517,7 +1517,7 @@ func TestEIBCFulfillment_two_rollapps_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -1910,7 +1910,7 @@ func TestEIBCFulfillment_ThirdParty_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -2306,7 +2306,7 @@ func TestEIBCFulfillment_ThirdParty_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -2676,7 +2676,7 @@ func TestEIBCFulfillment_ignore_hub_to_RA_EVM(t *testing.T) { SkipPathCreation: true, // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -2927,7 +2927,7 @@ func TestEIBCFulfillment_ignore_hub_to_RA_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) diff --git a/tests/eibc_invariant_test.go b/tests/eibc_invariant_test.go index fdc9d897..7e9242bd 100644 --- a/tests/eibc_invariant_test.go +++ b/tests/eibc_invariant_test.go @@ -132,7 +132,7 @@ func TestEIBCInvariant_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -480,7 +480,7 @@ func TestEIBCInvariant_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) diff --git a/tests/eibc_nobalance_test.go b/tests/eibc_nobalance_test.go index b095469b..0be23697 100644 --- a/tests/eibc_nobalance_test.go +++ b/tests/eibc_nobalance_test.go @@ -128,7 +128,7 @@ func TestEIBCNoBalanceToFulfillOrder_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) diff --git a/tests/eibc_not_fulfillment_test.go b/tests/eibc_not_fulfillment_test.go index 387b1d46..fb0afd5f 100644 --- a/tests/eibc_not_fulfillment_test.go +++ b/tests/eibc_not_fulfillment_test.go @@ -165,7 +165,7 @@ func TestEIBCNotFulfillment_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -439,7 +439,7 @@ func TestEIBCNotFulfillment_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) diff --git a/tests/eibc_pfm_test.go b/tests/eibc_pfm_test.go index 82024c92..edccf7ee 100644 --- a/tests/eibc_pfm_test.go +++ b/tests/eibc_pfm_test.go @@ -166,7 +166,7 @@ func TestEIBCPFM_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -440,7 +440,7 @@ func TestEIBCPFM_Wasm(t *testing.T) { SkipPathCreation: true, // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) diff --git a/tests/eibc_timeout_test.go b/tests/eibc_timeout_test.go index 1b0611a7..402148b6 100644 --- a/tests/eibc_timeout_test.go +++ b/tests/eibc_timeout_test.go @@ -127,7 +127,7 @@ func TestEIBCTimeoutDymToRollapp_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -440,7 +440,7 @@ func TestEIBCTimeoutFulFillDymToRollapp_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -818,7 +818,7 @@ func TestEIBCTimeoutFulFillDymToRollapp_Wasm(t *testing.T) { SkipPathCreation: true, // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) diff --git a/tests/erc20_ibc_transfer_test.go b/tests/erc20_ibc_transfer_test.go index dd9ac2e8..1ecc9cda 100644 --- a/tests/erc20_ibc_transfer_test.go +++ b/tests/erc20_ibc_transfer_test.go @@ -136,7 +136,7 @@ func TestERC20HubToRollAppWithoutRegister_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -368,7 +368,7 @@ func TestERC20RollAppToHubWithRegister_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) diff --git a/tests/frozen_test.go b/tests/frozen_test.go index 0d08f5d1..94f10be7 100644 --- a/tests/frozen_test.go +++ b/tests/frozen_test.go @@ -172,7 +172,7 @@ func TestRollAppFreeze_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -513,7 +513,7 @@ func TestRollAppFreeze_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -880,7 +880,7 @@ func TestOtherRollappNotAffected_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -1318,7 +1318,7 @@ func TestOtherRollappNotAffected_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -1708,7 +1708,7 @@ func TestPacketRollbacked_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -2026,7 +2026,7 @@ func TestPacketRollbacked_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -2397,7 +2397,7 @@ func TestRollAppFreezeNoBrokenInvariants_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -2732,7 +2732,7 @@ func TestRollAppFreezeNoBrokenInvariants_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -3067,7 +3067,7 @@ func TestRollAppSqcSlashedJailed_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -3477,7 +3477,7 @@ func TestRollAppSqcSlashedJailed_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -3851,7 +3851,7 @@ func TestRollAppFreezeStateNotProgressing_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -4172,7 +4172,7 @@ func TestRollAppFreezeStateNotProgressing_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -4493,7 +4493,7 @@ func TestRollAppFreezeEibcPending_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -4835,7 +4835,7 @@ func TestRollAppFreezeEibcPending_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) diff --git a/tests/fullnode_sync_block_sync_test.go b/tests/fullnode_sync_block_sync_test.go index b22e7289..e59b4cbf 100644 --- a/tests/fullnode_sync_block_sync_test.go +++ b/tests/fullnode_sync_block_sync_test.go @@ -128,7 +128,7 @@ func TestSync_BlockSync_EVM(t *testing.T) { Client: client, NetworkID: network, SkipPathCreation: true, - }, nil, "", nil) + }, nil, "", nil, true, 780) require.NoError(t, err) validator, err := celestia.Validators[0].AccountKeyBech32(ctx, "validator") @@ -263,12 +263,13 @@ func TestSync_BlockSync_EVM(t *testing.T) { ic = test.NewSetup(). AddRollUp(dymension, rollapp1) - _ = ic.Build(ctx, eRep, test.InterchainBuildOptions{ + err = ic.Build(ctx, eRep, test.InterchainBuildOptions{ TestName: t.Name(), Client: client, NetworkID: network, SkipPathCreation: true, - }, nil, "", nil) + }, nil, "", nil, true, 780) + require.NoError(t, err) // require.Error(t, err) containerID = fmt.Sprintf("rollappevm_1234-1-val-0-%s", t.Name()) @@ -474,7 +475,7 @@ func TestSync_BlockSync_fn_disconnect_EVM(t *testing.T) { Client: client, NetworkID: network, SkipPathCreation: true, - }, nil, "", nil) + }, nil, "", nil, true, 780) require.NoError(t, err) validator, err := celestia.Validators[0].AccountKeyBech32(ctx, "validator") @@ -609,12 +610,13 @@ func TestSync_BlockSync_fn_disconnect_EVM(t *testing.T) { ic = test.NewSetup(). AddRollUp(dymension, rollapp1) - _ = ic.Build(ctx, eRep, test.InterchainBuildOptions{ + err = ic.Build(ctx, eRep, test.InterchainBuildOptions{ TestName: t.Name(), Client: client, NetworkID: network, SkipPathCreation: true, - }, nil, "", nil) + }, nil, "", nil, true, 780) + require.NoError(t, err) containerID = fmt.Sprintf("rollappevm_1234-1-val-0-%s", t.Name()) diff --git a/tests/fullnode_sync_gossip_test.go b/tests/fullnode_sync_gossip_test.go index 895b3db9..86c9533d 100644 --- a/tests/fullnode_sync_gossip_test.go +++ b/tests/fullnode_sync_gossip_test.go @@ -125,7 +125,7 @@ func TestSync_Celes_Rt_Gossip_EVM(t *testing.T) { Client: client, NetworkID: network, SkipPathCreation: true, - }, nil, "", nil) + }, nil, "", nil, true, 780) require.NoError(t, err) validator, err := celestia.Validators[0].AccountKeyBech32(ctx, "validator") @@ -260,12 +260,13 @@ func TestSync_Celes_Rt_Gossip_EVM(t *testing.T) { ic = test.NewSetup(). AddRollUp(dymension, rollapp1) - _ = ic.Build(ctx, eRep, test.InterchainBuildOptions{ + err = ic.Build(ctx, eRep, test.InterchainBuildOptions{ TestName: t.Name(), Client: client, NetworkID: network, SkipPathCreation: true, - }, nil, "", nil) + }, nil, "", nil, true, 780) + require.NoError(t, err) containerID = fmt.Sprintf("rollappevm_1234-1-val-0-%s", t.Name()) @@ -447,7 +448,7 @@ func TestSync_Celes_Rt_Gossip_Wasm(t *testing.T) { Client: client, NetworkID: network, SkipPathCreation: true, - }, nil, "", nil) + }, nil, "", nil, true, 780) require.NoError(t, err) validator, err := celestia.Validators[0].AccountKeyBech32(ctx, "validator") @@ -600,7 +601,7 @@ func TestSync_Celes_Rt_Gossip_Wasm(t *testing.T) { Client: client, NetworkID: network, SkipPathCreation: true, - }, nil, "", nil) + }, nil, "", nil, true, 780) require.NoError(t, err) containerID = fmt.Sprintf("rollappwasm_1234-1-val-0-%s", t.Name()) @@ -782,7 +783,7 @@ func TestSync_Sqc_Disconnect_Gossip_EVM(t *testing.T) { Client: client, NetworkID: network, SkipPathCreation: true, - }, nil, "", nil) + }, nil, "", nil, true, 780) require.NoError(t, err) validator, err := celestia.Validators[0].AccountKeyBech32(ctx, "validator") @@ -917,12 +918,13 @@ func TestSync_Sqc_Disconnect_Gossip_EVM(t *testing.T) { ic = test.NewSetup(). AddRollUp(dymension, rollapp1) - _ = ic.Build(ctx, eRep, test.InterchainBuildOptions{ + err = ic.Build(ctx, eRep, test.InterchainBuildOptions{ TestName: t.Name(), Client: client, NetworkID: network, SkipPathCreation: true, - }, nil, "", nil) + }, nil, "", nil, true, 780) + require.NoError(t, err) containerID = fmt.Sprintf("rollappevm_1234-1-val-0-%s", t.Name()) @@ -1132,7 +1134,7 @@ func TestSync_Sqc_Disconnect_Gossip_Wasm(t *testing.T) { Client: client, NetworkID: network, SkipPathCreation: true, - }, nil, "", nil) + }, nil, "", nil, true, 780) require.NoError(t, err) validator, err := celestia.Validators[0].AccountKeyBech32(ctx, "validator") @@ -1272,7 +1274,7 @@ func TestSync_Sqc_Disconnect_Gossip_Wasm(t *testing.T) { Client: client, NetworkID: network, SkipPathCreation: true, - }, nil, "", nil) + }, nil, "", nil, true, 780) require.NoError(t, err) containerID = fmt.Sprintf("rollappwasm_1234-1-val-0-%s", t.Name()) @@ -1483,7 +1485,7 @@ func TestSync_Fullnode_Disconnect_Gossip_EVM(t *testing.T) { Client: client, NetworkID: network, SkipPathCreation: true, - }, nil, "", nil) + }, nil, "", nil, true, 780) require.NoError(t, err) validator, err := celestia.Validators[0].AccountKeyBech32(ctx, "validator") @@ -1618,12 +1620,13 @@ func TestSync_Fullnode_Disconnect_Gossip_EVM(t *testing.T) { ic = test.NewSetup(). AddRollUp(dymension, rollapp1) - _ = ic.Build(ctx, eRep, test.InterchainBuildOptions{ + err = ic.Build(ctx, eRep, test.InterchainBuildOptions{ TestName: t.Name(), Client: client, NetworkID: network, SkipPathCreation: true, - }, nil, "", nil) + }, nil, "", nil, true, 780) + require.NoError(t, err) containerID = fmt.Sprintf("rollappevm_1234-1-val-0-%s", t.Name()) @@ -1834,7 +1837,7 @@ func TestSync_Fullnode_Disconnect_Gossip_Wasm(t *testing.T) { Client: client, NetworkID: network, SkipPathCreation: true, - }, nil, "", nil) + }, nil, "", nil, true, 780) require.NoError(t, err) validator, err := celestia.Validators[0].AccountKeyBech32(ctx, "validator") @@ -1974,7 +1977,7 @@ func TestSync_Fullnode_Disconnect_Gossip_Wasm(t *testing.T) { Client: client, NetworkID: network, SkipPathCreation: true, - }, nil, "", nil) + }, nil, "", nil, true, 780) require.NoError(t, err) containerID = fmt.Sprintf("rollappwasm_1234-1-val-0-%s", t.Name()) diff --git a/tests/fullnode_sync_test.go b/tests/fullnode_sync_test.go index bcd9f06d..fb0575db 100644 --- a/tests/fullnode_sync_test.go +++ b/tests/fullnode_sync_test.go @@ -140,7 +140,7 @@ func TestFullnodeSync_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) // Wait for rollapp finalized @@ -277,7 +277,7 @@ func TestFullnodeSync_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) // Wait for rollapp finalized @@ -416,7 +416,7 @@ func TestFullnodeSync_Celestia_EVM(t *testing.T) { rep := testreporter.NewNopReporter() eRep := rep.RelayerExecReporter(t) - _ = ic.Build(ctx, eRep, test.InterchainBuildOptions{ + err = ic.Build(ctx, eRep, test.InterchainBuildOptions{ TestName: t.Name(), Client: client, NetworkID: network, @@ -424,8 +424,8 @@ func TestFullnodeSync_Celestia_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) - // require.NoError(t, err) + }, nil, "", nil, true, 780) + require.NoError(t, err) validator, err := celestia.Validators[0].AccountKeyBech32(ctx, "validator") require.NoError(t, err) @@ -565,7 +565,7 @@ func TestFullnodeSync_Celestia_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) rollappHeight, err := rollapp1.Validators[0].Height(ctx) @@ -691,7 +691,7 @@ func TestFullnodeSync_Celestia_Wasm(t *testing.T) { rep := testreporter.NewNopReporter() eRep := rep.RelayerExecReporter(t) - _ = ic.Build(ctx, eRep, test.InterchainBuildOptions{ + err = ic.Build(ctx, eRep, test.InterchainBuildOptions{ TestName: t.Name(), Client: client, NetworkID: network, @@ -699,8 +699,8 @@ func TestFullnodeSync_Celestia_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) - // require.NoError(t, err) + }, nil, "", nil, true, 780) + require.NoError(t, err) validator, err := celestia.Validators[0].AccountKeyBech32(ctx, "validator") require.NoError(t, err) @@ -834,7 +834,7 @@ func TestFullnodeSync_Celestia_Wasm(t *testing.T) { ic = test.NewSetup(). AddRollUp(dymension, rollapp1) - _ = ic.Build(ctx, eRep, test.InterchainBuildOptions{ + err = ic.Build(ctx, eRep, test.InterchainBuildOptions{ TestName: t.Name(), Client: client, NetworkID: network, @@ -842,7 +842,8 @@ func TestFullnodeSync_Celestia_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, true, 780) + require.NoError(t, err) rollappHeight, err := rollapp1.Validators[0].Height(ctx) require.NoError(t, err) diff --git a/tests/hardfork_test.go b/tests/hardfork_test.go index 9aaa4ec7..9caa3316 100644 --- a/tests/hardfork_test.go +++ b/tests/hardfork_test.go @@ -126,7 +126,7 @@ func TestHardFork_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -428,7 +428,7 @@ func TestHardFork_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, dymension, new_rollapp_id, []byte(genesis)) + }, dymension, new_rollapp_id, []byte(genesis), false, 780) require.NoError(t, err) CreateChannel(ctx, t, r2, eRep, dymension.CosmosChain, newRollApp.CosmosChain, anotherIbcPath) @@ -658,7 +658,7 @@ func TestHardFork_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -960,7 +960,7 @@ func TestHardFork_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, dymension, new_rollapp_id, []byte(genesis)) + }, dymension, new_rollapp_id, []byte(genesis), false, 780) require.NoError(t, err) CreateChannel(ctx, t, r2, eRep, dymension.CosmosChain, newRollApp.CosmosChain, anotherIbcPath) @@ -1185,7 +1185,7 @@ func TestHardForkRecoverIbcClient_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -1492,7 +1492,7 @@ func TestHardForkRecoverIbcClient_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, dymension, new_rollapp_id, []byte(genesis)) + }, dymension, new_rollapp_id, []byte(genesis), false, 780) require.NoError(t, err) CreateChannel(ctx, t, r2, eRep, dymension.CosmosChain, newRollApp.CosmosChain, anotherIbcPath) diff --git a/tests/ibc_finalize_block_test.go b/tests/ibc_finalize_block_test.go index a975f9b1..d65b2149 100644 --- a/tests/ibc_finalize_block_test.go +++ b/tests/ibc_finalize_block_test.go @@ -114,7 +114,7 @@ func TestDymFinalizeBlock_OnRecvPacket_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -316,7 +316,7 @@ func TestDymFinalizeBlock_OnAckPacket_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) // Create some user accounts on both chains @@ -492,7 +492,7 @@ func TestDymFinalizeBlock_OnTimeOutPacket_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -680,7 +680,7 @@ func TestDymFinalizeBlock_OnRecvPacket_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -886,7 +886,7 @@ func TestDymFinalizeBlock_OnAckPacket_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) // Create some user accounts on both chains @@ -1063,7 +1063,7 @@ func TestDymFinalizeBlock_OnTimeOutPacket_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) diff --git a/tests/ibc_grace_period_test.go b/tests/ibc_grace_period_test.go index 6140910e..2816db30 100644 --- a/tests/ibc_grace_period_test.go +++ b/tests/ibc_grace_period_test.go @@ -164,7 +164,7 @@ func TestIBCGracePeriodCompliance_EVM(t *testing.T) { SkipPathCreation: true, // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -452,7 +452,7 @@ func TestIBCGracePeriodCompliance_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -744,7 +744,7 @@ func TestDelayedAck_NoFinalizedStates_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -1001,7 +1001,7 @@ func TestDelayedAck_NoFinalizedStates_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -1248,7 +1248,7 @@ func TestDelayedAck_RelayerDown_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -1552,7 +1552,7 @@ func TestDelayedAck_RelayerDown_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) diff --git a/tests/ibc_timeout_test.go b/tests/ibc_timeout_test.go index 6afd20d6..99277483 100644 --- a/tests/ibc_timeout_test.go +++ b/tests/ibc_timeout_test.go @@ -126,7 +126,7 @@ func TestIBCTransferTimeout_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -361,7 +361,7 @@ func TestIBCTransferTimeout_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) diff --git a/tests/ibc_transfer_test.go b/tests/ibc_transfer_test.go index ae5bc020..65461044 100644 --- a/tests/ibc_transfer_test.go +++ b/tests/ibc_transfer_test.go @@ -98,7 +98,7 @@ func TestSpinUp(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) } @@ -194,7 +194,7 @@ func TestIBCTransferSuccess_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -370,7 +370,7 @@ func TestIBCTransferSuccess_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -544,7 +544,7 @@ func TestGenesisIBCTransferReservedMemo_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -710,7 +710,7 @@ func TestGenesisIBCTransferReservedMemo_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) diff --git a/tests/rollapp_invariant_test.go b/tests/rollapp_invariant_test.go index 90ce6ffa..dd862717 100644 --- a/tests/rollapp_invariant_test.go +++ b/tests/rollapp_invariant_test.go @@ -160,7 +160,7 @@ func TestRollappInvariant_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -415,7 +415,7 @@ func TestRollappInvariant_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) diff --git a/tests/rollapp_upgrade_test.go b/tests/rollapp_upgrade_test.go index 2c477397..f3ef02de 100644 --- a/tests/rollapp_upgrade_test.go +++ b/tests/rollapp_upgrade_test.go @@ -111,7 +111,7 @@ func TestRollappUpgradeNonStateBreaking_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -321,7 +321,7 @@ func TestRollappUpgradeNonStateBreaking_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -540,7 +540,7 @@ func TestRollapp_EVM_Upgrade(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -796,7 +796,7 @@ func TestRollapp_Wasm_Upgrade(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) diff --git a/tests/sequencer_invariant_test.go b/tests/sequencer_invariant_test.go index f548e8e0..b5b0a97a 100644 --- a/tests/sequencer_invariant_test.go +++ b/tests/sequencer_invariant_test.go @@ -160,7 +160,7 @@ func TestSequencerInvariant_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) _, _, err = rollapp1.GetNode().ExecInit(ctx, "sequencer1", "/var/cosmos-chain/sequencer1") @@ -418,7 +418,7 @@ func TestSequencerInvariant_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) _, _, err = rollapp1.GetNode().ExecInit(ctx, "sequencer1", "/var/cosmos-chain/sequencer1") diff --git a/tests/sequencer_rotation_test.go b/tests/sequencer_rotation_test.go index f52ab535..8ab29a45 100644 --- a/tests/sequencer_rotation_test.go +++ b/tests/sequencer_rotation_test.go @@ -9,11 +9,12 @@ import ( "testing" "time" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + "cosmossdk.io/math" "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" "github.com/decentrio/rollup-e2e-testing/cosmos/rollapp/dym_rollapp" "github.com/decentrio/rollup-e2e-testing/ibc" @@ -110,7 +111,7 @@ func Test_SeqRotation_NoSeq_DA_EVM(t *testing.T) { Client: client, NetworkID: network, SkipPathCreation: true, - }, nil, "", nil) + }, nil, "", nil, true, 780) require.NoError(t, err) // // Check IBC Transfer before switch @@ -313,13 +314,42 @@ func Test_SeqRotation_NoSeq_P2P_EVM(t *testing.T) { ctx := context.Background() // setup config for rollapp 1 - settlement_layer_rollapp1 := "dymension" - settlement_node_address := fmt.Sprintf("http://dymension_100-1-val-0-%s:26657", t.Name()) - rollapp1_id := "rollappevm_1234-1" - gas_price_rollapp1 := "0adym" - maxIdleTime1 := "5s" - maxProofTime := "500ms" - configFileOverrides := overridesDymintToml(settlement_layer_rollapp1, settlement_node_address, rollapp1_id, gas_price_rollapp1, maxIdleTime1, maxProofTime, "20s", false) + dymintTomlOverrides := make(testutil.Toml) + dymintTomlOverrides["settlement_layer"] = "dymension" + dymintTomlOverrides["settlement_node_address"] = fmt.Sprintf("http://dymension_100-1-val-0-%s:26657", t.Name()) + dymintTomlOverrides["rollapp_id"] = "rollappevm_1234-1" + dymintTomlOverrides["settlement_gas_prices"] = "0adym" + dymintTomlOverrides["max_idle_time"] = "3s" + dymintTomlOverrides["max_proof_time"] = "500ms" + dymintTomlOverrides["batch_submit_time"] = "50s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "true" + + configFileOverrides := make(map[string]any) + configFileOverrides["config/dymint.toml"] = dymintTomlOverrides + + modifyHubGenesisKV := append( + dymensionGenesisKV, + cosmos.GenesisKV{ + Key: "app_state.sequencer.params.unbonding_time", + Value: "300s", + }, + cosmos.GenesisKV{ + Key: "app_state.staking.params.unbonding_time", + Value: "300s", + }, + ) + + modifyRAGenesisKV := append( + rollappEVMGenesisKV, + cosmos.GenesisKV{ + Key: "app_state.sequencers.params.unbonding_time", + Value: "300s", + }, + cosmos.GenesisKV{ + Key: "app_state.staking.params.unbonding_time", + Value: "300s", + }, + ) // Create chain factory with dymension numHubVals := 1 @@ -344,15 +374,31 @@ func Test_SeqRotation_NoSeq_P2P_EVM(t *testing.T) { TrustingPeriod: "112h", EncodingConfig: encodingConfig(), NoHostMount: false, - ModifyGenesis: modifyRollappEVMGenesis(rollappEVMGenesisKV), + ModifyGenesis: modifyRollappEVMGenesis(modifyRAGenesisKV), ConfigFileOverrides: configFileOverrides, }, NumValidators: &numRollAppVals, NumFullNodes: &numRollAppFn, }, { - Name: "dymension-hub", - ChainConfig: dymensionConfig, + Name: "dymension-hub", + ChainConfig: ibc.ChainConfig{ + Type: "hub-dym", + Name: "dymension", + ChainID: "dymension_100-1", + Images: []ibc.DockerImage{dymensionImage}, + Bin: "dymd", + Bech32Prefix: "dym", + Denom: "adym", + CoinType: "60", + GasPrices: "0.0adym", + EncodingConfig: encodingConfig(), + GasAdjustment: 1.1, + TrustingPeriod: "112h", + NoHostMount: false, + ModifyGenesis: modifyDymensionGenesis(modifyHubGenesisKV), + ConfigFileOverrides: nil, + }, NumValidators: &numHubVals, NumFullNodes: &numHubFullNodes, }, @@ -391,11 +437,13 @@ func Test_SeqRotation_NoSeq_P2P_EVM(t *testing.T) { Client: client, NetworkID: network, SkipPathCreation: true, - }, nil, "", nil) + }, nil, "", nil, true, 195) require.NoError(t, err) containerID := fmt.Sprintf("rollappevm_1234-1-val-0-%s", t.Name()) + time.Sleep(60 * time.Second) + // Get the container details containerJSON, err := client.ContainerInspect(context.Background(), containerID) require.NoError(t, err) @@ -447,6 +495,22 @@ func Test_SeqRotation_NoSeq_P2P_EVM(t *testing.T) { err = rollapp1.FullNodes[0].StartContainer(ctx) require.NoError(t, err) + addrDym, _ := r.GetWallet(dymension.GetChainID()) + err = dymension.GetNode().SendFunds(ctx, "faucet", ibc.WalletData{ + Address: addrDym.FormattedAddress(), + Amount: math.NewInt(10_000_000_000_000), + Denom: dymension.Config().Denom, + }) + require.NoError(t, err) + + addrRA, _ := r.GetWallet(rollapp1.GetChainID()) + err = rollapp1.GetNode().SendFunds(ctx, "faucet", ibc.WalletData{ + Address: addrRA.FormattedAddress(), + Amount: math.NewInt(10_000_000_000_000), + Denom: rollapp1.Config().Denom, + }) + require.NoError(t, err) + // Check IBC Transfer before switch CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) @@ -454,13 +518,13 @@ func Test_SeqRotation_NoSeq_P2P_EVM(t *testing.T) { users := test.GetAndFundTestUsers(t, ctx, t.Name(), walletAmount, dymension, rollapp1) // Get our Bech32 encoded user addresses - dymensionUser, rollappUser := users[0], users[1] + // dymensionUser, rollappUser := users[0], users[1] - dymensionUserAddr := dymensionUser.FormattedAddress() - rollappUserAddr := rollappUser.FormattedAddress() + // dymensionUserAddr := dymensionUser.FormattedAddress() + // rollappUserAddr := rollappUser.FormattedAddress() - channel, err := ibc.GetTransferChannel(ctx, r, eRep, dymension.Config().ChainID, rollapp1.Config().ChainID) - require.NoError(t, err) + // 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) @@ -468,88 +532,94 @@ func Test_SeqRotation_NoSeq_P2P_EVM(t *testing.T) { err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) require.NoError(t, err) - // Send a normal ibc tx from RA -> Hub - transferData := ibc.WalletData{ - Address: dymensionUserAddr, - Denom: rollapp1.Config().Denom, - Amount: transferAmount, - } + // // Send a normal ibc tx from RA -> Hub + // transferData := ibc.WalletData{ + // Address: dymensionUserAddr, + // Denom: rollapp1.Config().Denom, + // Amount: transferAmount, + // } - // Compose an IBC transfer and send from rollapp -> Hub - _, err = rollapp1.SendIBCTransfer(ctx, channel.ChannelID, rollappUserAddr, transferData, ibc.TransferOptions{}) - require.NoError(t, err) + // // Compose an IBC transfer and send from rollapp -> Hub + // _, err = rollapp1.SendIBCTransfer(ctx, channel.ChannelID, rollappUserAddr, transferData, ibc.TransferOptions{}) + // require.NoError(t, err) - rollappHeight, err := rollapp1.GetNode().Height(ctx) - require.NoError(t, err) + // rollappHeight, err := rollapp1.GetNode().Height(ctx) + // require.NoError(t, err) - // Assert balance was updated on the hub - testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferData.Amount)) + // // Assert balance was updated on the hub + // testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferData.Amount)) - // wait until the packet is finalized - isFinalized, err := dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp1.GetChainID(), rollappHeight, 300) - require.NoError(t, err) - require.True(t, isFinalized) + // // wait until the packet is finalized + // isFinalized, err := dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp1.GetChainID(), rollappHeight, 300) + // require.NoError(t, err) + // require.True(t, isFinalized) - // Get the IBC denom for urax on Hub - rollappTokenDenom := transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, rollapp1.Config().Denom) - rollappIBCDenom := transfertypes.ParseDenomTrace(rollappTokenDenom).IBCDenom() + // // Get the IBC denom for urax on Hub + // rollappTokenDenom := transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, rollapp1.Config().Denom) + // rollappIBCDenom := transfertypes.ParseDenomTrace(rollappTokenDenom).IBCDenom() - testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, rollappIBCDenom, transferAmount.Sub(bridgingFee)) + // testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, rollappIBCDenom, transferAmount.Sub(bridgingFee)) - // Get original account balances - dymensionOrigBal, err := dymension.GetBalance(ctx, dymensionUserAddr, dymension.Config().Denom) - require.NoError(t, err) + // // Get original account balances + // dymensionOrigBal, err := dymension.GetBalance(ctx, dymensionUserAddr, dymension.Config().Denom) + // require.NoError(t, err) - // Compose an IBC transfer and send from dymension -> rollapp - transferData = ibc.WalletData{ - Address: rollappUserAddr, - Denom: dymension.Config().Denom, - Amount: transferAmount, - } + // // Compose an IBC transfer and send from dymension -> rollapp + // transferData = ibc.WalletData{ + // Address: rollappUserAddr, + // Denom: dymension.Config().Denom, + // Amount: transferAmount, + // } - // Compose an IBC transfer and send from Hub -> rollapp - _, err = dymension.SendIBCTransfer(ctx, channel.ChannelID, dymensionUserAddr, transferData, ibc.TransferOptions{}) - require.NoError(t, err) + // // Compose an IBC transfer and send from Hub -> rollapp + // _, err = dymension.SendIBCTransfer(ctx, channel.ChannelID, dymensionUserAddr, transferData, ibc.TransferOptions{}) + // require.NoError(t, err) - // Assert balance was updated on the hub - testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) + // // Assert balance was updated on the hub + // testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) - err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) - require.NoError(t, err) + // err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) + // require.NoError(t, err) - // Get the IBC denom - dymensionTokenDenom := transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, dymension.Config().Denom) - dymensionIBCDenom := transfertypes.ParseDenomTrace(dymensionTokenDenom).IBCDenom() + // // Get the IBC denom + // dymensionTokenDenom := transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, dymension.Config().Denom) + // dymensionIBCDenom := transfertypes.ParseDenomTrace(dymensionTokenDenom).IBCDenom() - testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) - erc20MAcc, err := rollapp1.Validators[0].QueryModuleAccount(ctx, "erc20") - require.NoError(t, err) - erc20MAccAddr := erc20MAcc.Account.BaseAccount.Address - testutil.AssertBalance(t, ctx, rollapp1, erc20MAccAddr, dymensionIBCDenom, transferData.Amount) + // testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) + // erc20MAcc, err := rollapp1.Validators[0].QueryModuleAccount(ctx, "erc20") + // require.NoError(t, err) + // erc20MAccAddr := erc20MAcc.Account.BaseAccount.Address + // testutil.AssertBalance(t, ctx, rollapp1, erc20MAccAddr, dymensionIBCDenom, transferData.Amount) // Unbond sequencer1 - err = dymension.Unbond(ctx, rollapp1.GetSequencer(), rollapp1.GetSequencerKeyDir()) + err = dymension.Unbond(ctx, "sequencer", rollapp1.GetSequencerKeyDir()) require.NoError(t, err) - seqAddr, err := dymension.AccountKeyBech32WithKeyDir(ctx, rollapp1.GetSequencer(), rollapp1.GetSequencerKeyDir()) + seqAddr, err := dymension.AccountKeyBech32WithKeyDir(ctx, "sequencer", rollapp1.GetSequencerKeyDir()) require.NoError(t, err) queryGetSequencerResponse, err := dymension.QueryShowSequencer(ctx, seqAddr) require.NoError(t, err) - require.Equal(t, queryGetSequencerResponse.Sequencer.Status, "OPERATING_STATUS_UNBONDING") + require.Equal(t, "OPERATING_STATUS_BONDED", queryGetSequencerResponse.Sequencer.Status) err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) require.NoError(t, err) - time.Sleep(150 * time.Second) + lastBlock, err := rollapp1.Height(ctx) + require.NoError(t, err) + + time.Sleep(180 * time.Second) + + queryGetSequencerResponse, err = dymension.QueryShowSequencer(ctx, seqAddr) + require.NoError(t, err) + require.Equal(t, "OPERATING_STATUS_UNBONDING", queryGetSequencerResponse.Sequencer.Status) + + time.Sleep(120 * time.Second) // Chain halted err = testutil.WaitForBlocks(ctx, 5, dymension, rollapp1) require.Error(t, err) - lastBlock, err := rollapp1.Height(ctx) - require.NoError(t, err) - // create 1 more sequencer _, _, err = rollapp1.GetNode().ExecInit(ctx, "sequencer1", "/var/cosmos-chain/sequencer1") require.NoError(t, err) @@ -562,15 +632,15 @@ func Test_SeqRotation_NoSeq_P2P_EVM(t *testing.T) { users = test.GetAndFundTestUsers(t, ctx, t.Name(), walletAmount, dymension) // Wait a few blocks for relayer to start and for user accounts to be created - err = testutil.WaitForBlocks(ctx, 5, dymension, rollapp1) + err = testutil.WaitForBlocks(ctx, 5, dymension) require.NoError(t, err) sequencer1 := users[0] - command := []string{"dymd", "tx", "sequencer", "create-sequencer", string(pub1), rollapp1.Config().ChainID, rollapp1.GetSequencerKeyDir() + "/metadata_sequencer.json", "1000000000adym", + command := []string{"sequencer", "create-sequencer", string(pub1), rollapp1.Config().ChainID, "1000000000adym", rollapp1.GetSequencerKeyDir() + "/metadata_sequencer.json", "--broadcast-mode", "async"} - _, err = dymension.Validators[0].ExecTx(ctx, sequencer1.KeyName(), command...) + _, err = dymension.FullNodes[0].ExecTx(ctx, sequencer1.KeyName(), command...) require.NoError(t, err) res, err := dymension.QueryShowSequencerByRollapp(ctx, rollapp1.Config().ChainID) @@ -581,56 +651,56 @@ func Test_SeqRotation_NoSeq_P2P_EVM(t *testing.T) { require.NoError(t, err) require.True(t, afterBlock > lastBlock) - // Compose an IBC transfer and send from rollapp -> Hub - _, err = rollapp1.SendIBCTransfer(ctx, channel.ChannelID, rollappUserAddr, transferData, ibc.TransferOptions{}) - require.NoError(t, err) + // // Compose an IBC transfer and send from rollapp -> Hub + // _, err = rollapp1.SendIBCTransfer(ctx, channel.ChannelID, rollappUserAddr, transferData, ibc.TransferOptions{}) + // require.NoError(t, err) - // Check IBC after switch - rollappHeight, err = rollapp1.GetNode().Height(ctx) - require.NoError(t, err) + // // Check IBC after switch + // rollappHeight, err = rollapp1.GetNode().Height(ctx) + // require.NoError(t, err) - // Assert balance was updated on the hub - testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferData.Amount)) + // // Assert balance was updated on the hub + // testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferData.Amount)) - // wait until the packet is finalized - isFinalized, err = dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp1.GetChainID(), rollappHeight, 300) - require.NoError(t, err) - require.True(t, isFinalized) + // // wait until the packet is finalized + // isFinalized, err = dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp1.GetChainID(), rollappHeight, 300) + // require.NoError(t, err) + // require.True(t, isFinalized) - // Get the IBC denom for urax on Hub - rollappTokenDenom = transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, rollapp1.Config().Denom) - rollappIBCDenom = transfertypes.ParseDenomTrace(rollappTokenDenom).IBCDenom() + // // Get the IBC denom for urax on Hub + // rollappTokenDenom = transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, rollapp1.Config().Denom) + // rollappIBCDenom = transfertypes.ParseDenomTrace(rollappTokenDenom).IBCDenom() - testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, rollappIBCDenom, transferAmount.Sub(bridgingFee)) + // testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, rollappIBCDenom, transferAmount.Sub(bridgingFee)) - // Get original account balances - dymensionOrigBal, err = dymension.GetBalance(ctx, dymensionUserAddr, dymension.Config().Denom) - require.NoError(t, err) + // // Get original account balances + // dymensionOrigBal, err = dymension.GetBalance(ctx, dymensionUserAddr, dymension.Config().Denom) + // require.NoError(t, err) - // Compose an IBC transfer and send from dymension -> rollapp - transferData = ibc.WalletData{ - Address: rollappUserAddr, - Denom: dymension.Config().Denom, - Amount: transferAmount, - } + // // Compose an IBC transfer and send from dymension -> rollapp + // transferData = ibc.WalletData{ + // Address: rollappUserAddr, + // Denom: dymension.Config().Denom, + // Amount: transferAmount, + // } - // Compose an IBC transfer and send from Hub -> rollapp - _, err = dymension.SendIBCTransfer(ctx, channel.ChannelID, dymensionUserAddr, transferData, ibc.TransferOptions{}) - require.NoError(t, err) + // // Compose an IBC transfer and send from Hub -> rollapp + // _, err = dymension.SendIBCTransfer(ctx, channel.ChannelID, dymensionUserAddr, transferData, ibc.TransferOptions{}) + // require.NoError(t, err) - // Assert balance was updated on the hub - testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) + // // Assert balance was updated on the hub + // testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) - err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) - require.NoError(t, err) + // err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) + // require.NoError(t, err) - // Get the IBC denom - dymensionTokenDenom = transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, dymension.Config().Denom) - dymensionIBCDenom = transfertypes.ParseDenomTrace(dymensionTokenDenom).IBCDenom() + // // Get the IBC denom + // dymensionTokenDenom = transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, dymension.Config().Denom) + // dymensionIBCDenom = transfertypes.ParseDenomTrace(dymensionTokenDenom).IBCDenom() - testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) - erc20MAcc, err = rollapp1.Validators[0].QueryModuleAccount(ctx, "erc20") - require.NoError(t, err) - erc20MAccAddr = erc20MAcc.Account.BaseAccount.Address - testutil.AssertBalance(t, ctx, rollapp1, erc20MAccAddr, dymensionIBCDenom, transferData.Amount) + // testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) + // erc20MAcc, err = rollapp1.Validators[0].QueryModuleAccount(ctx, "erc20") + // require.NoError(t, err) + // erc20MAccAddr = erc20MAcc.Account.BaseAccount.Address + // testutil.AssertBalance(t, ctx, rollapp1, erc20MAccAddr, dymensionIBCDenom, transferData.Amount) } diff --git a/tests/sequencer_test.go b/tests/sequencer_test.go index 1667e410..c9d52e81 100644 --- a/tests/sequencer_test.go +++ b/tests/sequencer_test.go @@ -129,7 +129,7 @@ func TestSequencerCelestia_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) validator, err := celestia.GetNode().AccountKeyBech32(ctx, "validator") @@ -277,7 +277,7 @@ func TestSequencerCelestia_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) celestia.StopAllNodes(ctx) @@ -416,7 +416,7 @@ func TestSequencerHubDisconnection_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) validator, err := celestia.GetNode().AccountKeyBech32(ctx, "validator") @@ -574,7 +574,7 @@ func TestSequencerHubDisconnection_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) rollappHeight, err := rollapp1.GetNode().Height(ctx) diff --git a/tests/tx_batch_finalization_test.go b/tests/tx_batch_finalization_test.go index 0cd053e9..d55e8dd0 100644 --- a/tests/tx_batch_finalization_test.go +++ b/tests/tx_batch_finalization_test.go @@ -121,7 +121,7 @@ func TestBatchFinalization_EVM(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) // Create some user accounts on both chains @@ -252,7 +252,7 @@ func TestBatchFinalization_Wasm(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) // Create some user accounts on both chains diff --git a/tests/upgrade_hub_test.go b/tests/upgrade_hub_test.go index 43a8cb8d..81ed030b 100644 --- a/tests/upgrade_hub_test.go +++ b/tests/upgrade_hub_test.go @@ -179,7 +179,7 @@ func TestHubUpgrade(t *testing.T) { // This can be used to write to the block database which will index all block data e.g. txs, msgs, events, etc. // BlockDatabaseFile: test.DefaultBlockDatabaseFilepath(), - }, nil, "", nil) + }, nil, "", nil, false, 780) require.NoError(t, err) // err = dymension.StopAllNodes(ctx) From f71ded7fdefc5df19e0536b137529c60305eea0b Mon Sep 17 00:00:00 2001 From: anhductn2001 Date: Mon, 23 Sep 2024 17:56:13 +0700 Subject: [PATCH 5/6] monir --- tests/sequencer_rotation_test.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/sequencer_rotation_test.go b/tests/sequencer_rotation_test.go index 8ab29a45..a892145c 100644 --- a/tests/sequencer_rotation_test.go +++ b/tests/sequencer_rotation_test.go @@ -442,8 +442,6 @@ func Test_SeqRotation_NoSeq_P2P_EVM(t *testing.T) { containerID := fmt.Sprintf("rollappevm_1234-1-val-0-%s", t.Name()) - time.Sleep(60 * time.Second) - // Get the container details containerJSON, err := client.ContainerInspect(context.Background(), containerID) require.NoError(t, err) @@ -614,17 +612,17 @@ func Test_SeqRotation_NoSeq_P2P_EVM(t *testing.T) { require.NoError(t, err) require.Equal(t, "OPERATING_STATUS_UNBONDING", queryGetSequencerResponse.Sequencer.Status) - time.Sleep(120 * time.Second) - // Chain halted err = testutil.WaitForBlocks(ctx, 5, dymension, rollapp1) require.Error(t, err) - // create 1 more sequencer - _, _, err = rollapp1.GetNode().ExecInit(ctx, "sequencer1", "/var/cosmos-chain/sequencer1") + time.Sleep(300 * time.Second) + + queryGetSequencerResponse, err = dymension.QueryShowSequencer(ctx, seqAddr) require.NoError(t, err) + require.Equal(t, "OPERATING_STATUS_UNBONDED", queryGetSequencerResponse.Sequencer.Status) - cmd := append([]string{rollapp1.Validators[0].Chain.Config().Bin}, "dymint", "show-sequencer", "--home", "/var/cosmos-chain/sequencer1") + cmd := append([]string{rollapp1.FullNodes[0].Chain.Config().Bin}, "dymint", "show-sequencer", "--home", rollapp1.FullNodes[0].HomeDir()) pub1, _, err := rollapp1.GetNode().Exec(ctx, cmd, nil) require.NoError(t, err) @@ -647,6 +645,12 @@ func Test_SeqRotation_NoSeq_P2P_EVM(t *testing.T) { require.NoError(t, err) require.Equal(t, len(res.Sequencers), 2, "should have 2 sequences") + err = rollapp1.StopAllNodes(ctx) + require.NoError(t, err) + + err = rollapp1.StartAllNodes(ctx) + require.NoError(t, err) + afterBlock, err := rollapp1.Height(ctx) require.NoError(t, err) require.True(t, afterBlock > lastBlock) From a199e0500b571035496bc2efa60f49b7f461e438 Mon Sep 17 00:00:00 2001 From: anhductn2001 Date: Tue, 24 Sep 2024 10:28:24 +0700 Subject: [PATCH 6/6] add ibc check --- tests/data/metadata_sequencer1.json | 14 ++ tests/erc20_ibc_transfer_test.go | 22 +-- tests/sequencer_rotation_test.go | 206 ++++++++++++++-------------- 3 files changed, 120 insertions(+), 122 deletions(-) create mode 100644 tests/data/metadata_sequencer1.json diff --git a/tests/data/metadata_sequencer1.json b/tests/data/metadata_sequencer1.json new file mode 100644 index 00000000..de4cf4d3 --- /dev/null +++ b/tests/data/metadata_sequencer1.json @@ -0,0 +1,14 @@ +{ + "moniker": "sequencer", + "details": "This is a description of the Rollapp.", + "p2p_seeds": ["seed1"], + "rpcs": ["https://rpc.wpd.evm.rollapp.noisnemyd.xyz:443", "https://rpc.wpd.wasm.rollapp.noisnemyd.xyz:443"], + "evm_rpcs": ["https://rpc.wpd.evm.evm.noisnemyd.xyz:443"], + "rest_api_urls": ["https://api.wpd.evm.rollapp.noisnemyd.xyz:443"], + "explorer_url": "explorer_url", + "genesis_urls": ["genesis"], + "contact_details":{}, + "extra_data": [], + "snapshots": [], + "gas_price": "0" + } \ No newline at end of file diff --git a/tests/erc20_ibc_transfer_test.go b/tests/erc20_ibc_transfer_test.go index 1ecc9cda..86fd4ee9 100644 --- a/tests/erc20_ibc_transfer_test.go +++ b/tests/erc20_ibc_transfer_test.go @@ -45,15 +45,6 @@ func TestERC20HubToRollAppWithoutRegister_EVM(t *testing.T) { numRollAppFn := 0 numRollAppVals := 1 - // Enable erc20 - modifyRollappGeneisKV := append( - rollappEVMGenesisKV, - cosmos.GenesisKV{ - Key: "app_state.erc20.params.enable_erc20", - Value: true, - }, - ) - cf := test.NewBuiltinChainFactory(zaptest.NewLogger(t), []*test.ChainSpec{ { Name: "rollapp1", @@ -71,7 +62,7 @@ func TestERC20HubToRollAppWithoutRegister_EVM(t *testing.T) { TrustingPeriod: "112h", EncodingConfig: encodingConfig(), NoHostMount: false, - ModifyGenesis: modifyRollappEVMGenesis(modifyRollappGeneisKV), + ModifyGenesis: modifyRollappEVMGenesis(rollappEVMGenesisKV), ConfigFileOverrides: configFileOverrides, }, NumValidators: &numRollAppVals, @@ -278,15 +269,6 @@ func TestERC20RollAppToHubWithRegister_EVM(t *testing.T) { numRollAppFn := 0 numRollAppVals := 1 - // Enable erc20 - modifyRollappGeneisKV := append( - rollappEVMGenesisKV, - cosmos.GenesisKV{ - Key: "app_state.erc20.params.enable_erc20", - Value: true, - }, - ) - cf := test.NewBuiltinChainFactory(zaptest.NewLogger(t), []*test.ChainSpec{ { Name: "rollapp1", @@ -304,7 +286,7 @@ func TestERC20RollAppToHubWithRegister_EVM(t *testing.T) { TrustingPeriod: "112h", EncodingConfig: encodingConfig(), NoHostMount: false, - ModifyGenesis: modifyRollappEVMGenesis(modifyRollappGeneisKV), + ModifyGenesis: modifyRollappEVMGenesis(rollappEVMGenesisKV), ConfigFileOverrides: configFileOverrides, }, NumValidators: &numRollAppVals, diff --git a/tests/sequencer_rotation_test.go b/tests/sequencer_rotation_test.go index a892145c..db703cb9 100644 --- a/tests/sequencer_rotation_test.go +++ b/tests/sequencer_rotation_test.go @@ -10,6 +10,7 @@ import ( "time" "cosmossdk.io/math" + transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" "github.com/stretchr/testify/require" "go.uber.org/zap/zaptest" @@ -114,85 +115,85 @@ func Test_SeqRotation_NoSeq_DA_EVM(t *testing.T) { }, nil, "", nil, true, 780) require.NoError(t, err) - // // Check IBC Transfer before switch - // CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) + // Check IBC Transfer before switch + CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath) - // // Create some user accounts on both chains - // users := test.GetAndFundTestUsers(t, ctx, t.Name(), walletAmount, dymension, rollapp1) + // Create some user accounts on both chains + users := test.GetAndFundTestUsers(t, ctx, t.Name(), walletAmount, dymension, rollapp1) - // // Get our Bech32 encoded user addresses - // dymensionUser, rollappUser := users[0], users[1] + // Get our Bech32 encoded user addresses + dymensionUser, rollappUser := users[0], users[1] - // dymensionUserAddr := dymensionUser.FormattedAddress() - // rollappUserAddr := rollappUser.FormattedAddress() + dymensionUserAddr := dymensionUser.FormattedAddress() + rollappUserAddr := rollappUser.FormattedAddress() - // channel, err := ibc.GetTransferChannel(ctx, r, eRep, dymension.Config().ChainID, rollapp1.Config().ChainID) - // require.NoError(t, err) + 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 = r.StartRelayer(ctx, eRep, ibcPath) + require.NoError(t, err) - // err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) - // require.NoError(t, err) + err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) + require.NoError(t, err) - // // Send a normal ibc tx from RA -> Hub - // transferData := ibc.WalletData{ - // Address: dymensionUserAddr, - // Denom: rollapp1.Config().Denom, - // Amount: transferAmount, - // } + // Send a normal ibc tx from RA -> Hub + transferData := ibc.WalletData{ + Address: dymensionUserAddr, + Denom: rollapp1.Config().Denom, + Amount: transferAmount, + } - // // Compose an IBC transfer and send from rollapp -> Hub - // _, err = rollapp1.SendIBCTransfer(ctx, channel.ChannelID, rollappUserAddr, transferData, ibc.TransferOptions{}) - // require.NoError(t, err) + // Compose an IBC transfer and send from rollapp -> Hub + _, err = rollapp1.SendIBCTransfer(ctx, channel.ChannelID, rollappUserAddr, transferData, ibc.TransferOptions{}) + require.NoError(t, err) - // rollappHeight, err := rollapp1.GetNode().Height(ctx) - // require.NoError(t, err) + rollappHeight, err := rollapp1.GetNode().Height(ctx) + require.NoError(t, err) - // // Assert balance was updated on the hub - // testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferData.Amount)) + // Assert balance was updated on the hub + testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferData.Amount)) - // // wait until the packet is finalized - // isFinalized, err := dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp1.GetChainID(), rollappHeight, 300) - // require.NoError(t, err) - // require.True(t, isFinalized) + // wait until the packet is finalized + isFinalized, err := dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp1.GetChainID(), rollappHeight, 300) + require.NoError(t, err) + require.True(t, isFinalized) - // // Get the IBC denom for urax on Hub - // rollappTokenDenom := transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, rollapp1.Config().Denom) - // rollappIBCDenom := transfertypes.ParseDenomTrace(rollappTokenDenom).IBCDenom() + // Get the IBC denom for urax on Hub + rollappTokenDenom := transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, rollapp1.Config().Denom) + rollappIBCDenom := transfertypes.ParseDenomTrace(rollappTokenDenom).IBCDenom() - // testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, rollappIBCDenom, transferAmount.Sub(bridgingFee)) + testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, rollappIBCDenom, transferAmount.Sub(bridgingFee)) - // // Get original account balances - // dymensionOrigBal, err := dymension.GetBalance(ctx, dymensionUserAddr, dymension.Config().Denom) - // require.NoError(t, err) + // Get original account balances + dymensionOrigBal, err := dymension.GetBalance(ctx, dymensionUserAddr, dymension.Config().Denom) + require.NoError(t, err) - // // Compose an IBC transfer and send from dymension -> rollapp - // transferData = ibc.WalletData{ - // Address: rollappUserAddr, - // Denom: dymension.Config().Denom, - // Amount: transferAmount, - // } + // Compose an IBC transfer and send from dymension -> rollapp + transferData = ibc.WalletData{ + Address: rollappUserAddr, + Denom: dymension.Config().Denom, + Amount: transferAmount, + } - // // Compose an IBC transfer and send from Hub -> rollapp - // _, err = dymension.SendIBCTransfer(ctx, channel.ChannelID, dymensionUserAddr, transferData, ibc.TransferOptions{}) - // require.NoError(t, err) + // Compose an IBC transfer and send from Hub -> rollapp + _, err = dymension.SendIBCTransfer(ctx, channel.ChannelID, dymensionUserAddr, transferData, ibc.TransferOptions{}) + require.NoError(t, err) - // // Assert balance was updated on the hub - // testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) + // Assert balance was updated on the hub + testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) - // err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) - // require.NoError(t, err) + err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) + require.NoError(t, err) - // // Get the IBC denom - // dymensionTokenDenom := transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, dymension.Config().Denom) - // dymensionIBCDenom := transfertypes.ParseDenomTrace(dymensionTokenDenom).IBCDenom() + // Get the IBC denom + dymensionTokenDenom := transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, dymension.Config().Denom) + dymensionIBCDenom := transfertypes.ParseDenomTrace(dymensionTokenDenom).IBCDenom() - // testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) - // erc20MAcc, err := rollapp1.Validators[0].QueryModuleAccount(ctx, "erc20") - // require.NoError(t, err) - // erc20MAccAddr := erc20MAcc.Account.BaseAccount.Address - // testutil.AssertBalance(t, ctx, rollapp1, erc20MAccAddr, dymensionIBCDenom, transferData.Amount) + testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) + erc20MAcc, err := rollapp1.Validators[0].QueryModuleAccount(ctx, "erc20") + require.NoError(t, err) + erc20MAccAddr := erc20MAcc.Account.BaseAccount.Address + testutil.AssertBalance(t, ctx, rollapp1, erc20MAccAddr, dymensionIBCDenom, transferData.Amount) // Unbond sequencer1 err = dymension.Unbond(ctx, "sequencer", rollapp1.GetSequencerKeyDir()) @@ -230,7 +231,7 @@ func Test_SeqRotation_NoSeq_DA_EVM(t *testing.T) { require.NoError(t, err) // Create some user accounts on both chains - users := test.GetAndFundTestUsers(t, ctx, t.Name(), walletAmount, dymension) + users = test.GetAndFundTestUsers(t, ctx, t.Name(), walletAmount, dymension) // Wait a few blocks for relayer to start and for user accounts to be created err = testutil.WaitForBlocks(ctx, 5, dymension, rollapp1) @@ -252,58 +253,58 @@ func Test_SeqRotation_NoSeq_DA_EVM(t *testing.T) { require.NoError(t, err) require.True(t, afterBlock > lastBlock) - // // Compose an IBC transfer and send from rollapp -> Hub - // _, err = rollapp1.SendIBCTransfer(ctx, channel.ChannelID, rollappUserAddr, transferData, ibc.TransferOptions{}) - // require.NoError(t, err) + // Compose an IBC transfer and send from rollapp -> Hub + _, err = rollapp1.SendIBCTransfer(ctx, channel.ChannelID, rollappUserAddr, transferData, ibc.TransferOptions{}) + require.NoError(t, err) - // // Check IBC after switch - // rollappHeight, err = rollapp1.GetNode().Height(ctx) - // require.NoError(t, err) + // Check IBC after switch + rollappHeight, err = rollapp1.GetNode().Height(ctx) + require.NoError(t, err) - // // Assert balance was updated on the hub - // testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferData.Amount)) + // Assert balance was updated on the hub + testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferData.Amount)) - // // wait until the packet is finalized - // isFinalized, err = dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp1.GetChainID(), rollappHeight, 300) - // require.NoError(t, err) - // require.True(t, isFinalized) + // wait until the packet is finalized + isFinalized, err = dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp1.GetChainID(), rollappHeight, 300) + require.NoError(t, err) + require.True(t, isFinalized) - // // Get the IBC denom for urax on Hub - // rollappTokenDenom = transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, rollapp1.Config().Denom) - // rollappIBCDenom = transfertypes.ParseDenomTrace(rollappTokenDenom).IBCDenom() + // Get the IBC denom for urax on Hub + rollappTokenDenom = transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, rollapp1.Config().Denom) + rollappIBCDenom = transfertypes.ParseDenomTrace(rollappTokenDenom).IBCDenom() - // testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, rollappIBCDenom, transferAmount.Sub(bridgingFee)) + testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, rollappIBCDenom, transferAmount.Sub(bridgingFee)) - // // Get original account balances - // dymensionOrigBal, err = dymension.GetBalance(ctx, dymensionUserAddr, dymension.Config().Denom) - // require.NoError(t, err) + // Get original account balances + dymensionOrigBal, err = dymension.GetBalance(ctx, dymensionUserAddr, dymension.Config().Denom) + require.NoError(t, err) - // // Compose an IBC transfer and send from dymension -> rollapp - // transferData = ibc.WalletData{ - // Address: rollappUserAddr, - // Denom: dymension.Config().Denom, - // Amount: transferAmount, - // } + // Compose an IBC transfer and send from dymension -> rollapp + transferData = ibc.WalletData{ + Address: rollappUserAddr, + Denom: dymension.Config().Denom, + Amount: transferAmount, + } - // // Compose an IBC transfer and send from Hub -> rollapp - // _, err = dymension.SendIBCTransfer(ctx, channel.ChannelID, dymensionUserAddr, transferData, ibc.TransferOptions{}) - // require.NoError(t, err) + // Compose an IBC transfer and send from Hub -> rollapp + _, err = dymension.SendIBCTransfer(ctx, channel.ChannelID, dymensionUserAddr, transferData, ibc.TransferOptions{}) + require.NoError(t, err) - // // Assert balance was updated on the hub - // testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) + // Assert balance was updated on the hub + testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) - // err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) - // require.NoError(t, err) + err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) + require.NoError(t, err) - // // Get the IBC denom - // dymensionTokenDenom = transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, dymension.Config().Denom) - // dymensionIBCDenom = transfertypes.ParseDenomTrace(dymensionTokenDenom).IBCDenom() + // Get the IBC denom + dymensionTokenDenom = transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, dymension.Config().Denom) + dymensionIBCDenom = transfertypes.ParseDenomTrace(dymensionTokenDenom).IBCDenom() - // testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) - // erc20MAcc, err = rollapp1.Validators[0].QueryModuleAccount(ctx, "erc20") - // require.NoError(t, err) - // erc20MAccAddr = erc20MAcc.Account.BaseAccount.Address - // testutil.AssertBalance(t, ctx, rollapp1, erc20MAccAddr, dymensionIBCDenom, transferData.Amount) + testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, dymensionOrigBal.Sub(transferData.Amount)) + erc20MAcc, err = rollapp1.Validators[0].QueryModuleAccount(ctx, "erc20") + require.NoError(t, err) + erc20MAccAddr = erc20MAcc.Account.BaseAccount.Address + testutil.AssertBalance(t, ctx, rollapp1, erc20MAccAddr, dymensionIBCDenom, transferData.Amount) } func Test_SeqRotation_NoSeq_P2P_EVM(t *testing.T) { @@ -648,8 +649,9 @@ func Test_SeqRotation_NoSeq_P2P_EVM(t *testing.T) { err = rollapp1.StopAllNodes(ctx) require.NoError(t, err) - err = rollapp1.StartAllNodes(ctx) - require.NoError(t, err) + _ = rollapp1.StartAllNodes(ctx) + + time.Sleep(30 * time.Second) afterBlock, err := rollapp1.Height(ctx) require.NoError(t, err)