diff --git a/Makefile b/Makefile index 363b926c..1a2c8df1 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,9 @@ e2e-test: clean-e2e # Executes IBC tests via rollup-e2e-testing e2e-test-ibc-success-evm: clean-e2e cd tests && go test -timeout=30m -race -v -run TestIBCTransferSuccess_EVM . + +e2e-test-spinup: clean-e2e + cd tests && go test -timeout=30m -race -v -run TestSpinUp . e2e-eibc-update-already-fulfill-evm: clean-e2e cd tests && go test -timeout=30m -race -v -run TestEIBCFulfillAlreadyFulfilledDemand_EVM . diff --git a/go.mod b/go.mod index 68ae669c..497af5cd 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ replace ( require ( github.com/decentrio/e2e-testing-live v0.0.0-20240718080249-ee255229c869 - github.com/decentrio/rollup-e2e-testing v0.0.0-20240718115231-5ffec3805af4 + github.com/decentrio/rollup-e2e-testing v0.0.0-20240805094848-68d57d56ae62 github.com/dymensionxyz/dymension/v3 v3.1.0-rc03.0.20240717194206-54c0fca5fada ) diff --git a/go.sum b/go.sum index de98de44..b2751a28 100644 --- a/go.sum +++ b/go.sum @@ -384,8 +384,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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-20240718115231-5ffec3805af4 h1:ZZFkAHWyK8KEF/tsyNIQ3xIhQHr2hAFyz0KE4iJM1q0= -github.com/decentrio/rollup-e2e-testing v0.0.0-20240718115231-5ffec3805af4/go.mod h1:NwTceYVxAaIZI65g/PdibVnGRMXuZzqzhDIkWsqJaQM= +github.com/decentrio/rollup-e2e-testing v0.0.0-20240805094848-68d57d56ae62 h1:9FL0ehOjknP7jgDXYlJ91MytI02CyYJOwtIZfelqypM= +github.com/decentrio/rollup-e2e-testing v0.0.0-20240805094848-68d57d56ae62/go.mod h1:NwTceYVxAaIZI65g/PdibVnGRMXuZzqzhDIkWsqJaQM= github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4= github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= diff --git a/tests/data/metadata.json b/tests/data/metadata.json new file mode 100644 index 00000000..a9b0e147 --- /dev/null +++ b/tests/data/metadata.json @@ -0,0 +1,8 @@ +{ + "website": "https://dymension.xyz/", + "description": "This is a description of the Rollapp.", + "logo_data_uri": "data:image/jpeg;base64,/000", + "token_logo_uri": "data:image/jpeg;base64,/000", + "telegram": "https://t.me/example", + "x": "https://x.com/dymension" + } \ No newline at end of file diff --git a/tests/disconnection_test.go b/tests/disconnection_test.go index d5d42f7d..8c28b74e 100644 --- a/tests/disconnection_test.go +++ b/tests/disconnection_test.go @@ -87,6 +87,9 @@ func customConfig() ibc.ChainConfig { if err := dyno.Set(g, "10000000000", "app_state", "gov", "params", "min_deposit", 0, "amount"); err != nil { return nil, fmt.Errorf("failed to set amount on gov min_deposit in genesis json: %w", err) } + if err := dyno.Set(g, "1000000000000", "app_state", "rollapp", "params", "registration_fee", "amount"); err != nil { + return nil, fmt.Errorf("failed to set registration_fee in genesis json: %w", err) + } if err := dyno.Set(g, "adym", "app_state", "gamm", "params", "pool_creation_fee", 0, "denom"); err != nil { return nil, fmt.Errorf("failed to set amount on gov min_deposit in genesis json: %w", err) } diff --git a/tests/ibc_transfer_test.go b/tests/ibc_transfer_test.go index 90875f6e..af810bc6 100644 --- a/tests/ibc_transfer_test.go +++ b/tests/ibc_transfer_test.go @@ -18,6 +18,89 @@ import ( "github.com/decentrio/rollup-e2e-testing/testutil" ) +func TestSpinUp(t *testing.T) { + if testing.Short() { + t.Skip() + } + + ctx := context.Background() + + configFileOverrides := make(map[string]any) + 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_max_time"] = "100s" + + configFileOverrides["config/dymint.toml"] = dymintTomlOverrides + // Create chain factory with dymension + numHubVals := 1 + numHubFullNodes := 1 + numRollAppFn := 0 + numRollAppVals := 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) + + ic := test.NewSetup(). + AddRollUp(dymension, rollapp1) + + rep := testreporter.NewNopReporter() + eRep := rep.RelayerExecReporter(t) + + err = ic.Build(ctx, eRep, test.InterchainBuildOptions{ + TestName: t.Name(), + Client: client, + NetworkID: network, + SkipPathCreation: true, + + // 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) +} + // TestIBCTransferSuccess ensure that the transfer between Hub and Rollapp is accurate. func TestIBCTransferSuccess_EVM(t *testing.T) { if testing.Short() { diff --git a/tests/sequencer_invariant_test.go b/tests/sequencer_invariant_test.go index 0fbde6db..064b4666 100644 --- a/tests/sequencer_invariant_test.go +++ b/tests/sequencer_invariant_test.go @@ -201,14 +201,14 @@ func TestSequencerInvariant_EVM(t *testing.T) { rollappUserAddr := rollappUser.FormattedAddress() command = []string{} - command = append(command, "sequencer", "create-sequencer", string(pub1), rollapp1.Config().ChainID, "{\"Moniker\":\"myrollapp-sequencer\",\"Identity\":\"\",\"Website\":\"\",\"SecurityContact\":\"\",\"Details\":\"\"}", "1000000000adym", + command = append(command, "sequencer", "create-sequencer", string(pub1), rollapp1.Config().ChainID, rollapp1.GetSequencerKeyDir()+"/metadata.json", "1000000000adym", "--broadcast-mode", "async") _, err = dymension.GetNode().ExecTx(ctx, sequencer1.KeyName(), command...) require.NoError(t, err) command = []string{} - command = append(command, "sequencer", "create-sequencer", string(pub2), rollapp1.Config().ChainID, "{\"Moniker\":\"myrollapp-sequencer\",\"Identity\":\"\",\"Website\":\"\",\"SecurityContact\":\"\",\"Details\":\"\"}", "1000000000adym", + command = append(command, "sequencer", "create-sequencer", string(pub2), rollapp1.Config().ChainID, rollapp1.GetSequencerKeyDir()+"/metadata.json", "1000000000adym", "--broadcast-mode", "async") _, err = dymension.GetNode().ExecTx(ctx, sequencer2.KeyName(), command...) @@ -467,14 +467,14 @@ func TestSequencerInvariant_Wasm(t *testing.T) { rollappUserAddr := rollappUser.FormattedAddress() command = []string{} - command = append(command, "sequencer", "create-sequencer", string(pub1), rollapp1.Config().ChainID, "{\"Moniker\":\"myrollapp-sequencer\",\"Identity\":\"\",\"Website\":\"\",\"SecurityContact\":\"\",\"Details\":\"\"}", "1000000000adym", + command = append(command, "sequencer", "create-sequencer", string(pub1), rollapp1.Config().ChainID, rollapp1.GetSequencerKeyDir()+"/metadata.json", "1000000000adym", "--broadcast-mode", "async") _, err = dymension.GetNode().ExecTx(ctx, sequencer1.KeyName(), command...) require.NoError(t, err) command = []string{} - command = append(command, "sequencer", "create-sequencer", string(pub2), rollapp1.Config().ChainID, "{\"Moniker\":\"myrollapp-sequencer\",\"Identity\":\"\",\"Website\":\"\",\"SecurityContact\":\"\",\"Details\":\"\"}", "1000000000adym", + command = append(command, "sequencer", "create-sequencer", string(pub2), rollapp1.Config().ChainID, rollapp1.GetSequencerKeyDir()+"/metadata.json", "1000000000adym", "--broadcast-mode", "async") _, err = dymension.GetNode().ExecTx(ctx, sequencer2.KeyName(), command...) diff --git a/tests/setup.go b/tests/setup.go index f9eff550..b70b6692 100644 --- a/tests/setup.go +++ b/tests/setup.go @@ -544,6 +544,9 @@ func modifyDymensionGenesis(genesisKV []cosmos.GenesisKV) func(ibc.ChainConfig, if err := dyno.Set(g, "adym", "app_state", "gov", "params", "min_deposit", 0, "denom"); err != nil { return nil, fmt.Errorf("failed to set denom on gov min_deposit in genesis json: %w", err) } + if err := dyno.Set(g, "1000000000000", "app_state", "rollapp", "params", "registration_fee", "amount"); err != nil { + return nil, fmt.Errorf("failed to set registration_fee in genesis json: %w", err) + } if err := dyno.Set(g, "10000000000", "app_state", "gov", "params", "min_deposit", 0, "amount"); err != nil { return nil, fmt.Errorf("failed to set amount on gov min_deposit in genesis json: %w", err) }