Skip to content

Commit

Permalink
chore: remove genesis account (#416)
Browse files Browse the repository at this point in the history
  • Loading branch information
anhductn2001 committed Sep 16, 2024
1 parent e765c18 commit c5269d3
Show file tree
Hide file tree
Showing 8 changed files with 683 additions and 651 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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-20240915121335-ddec1ae61af9
github.com/decentrio/rollup-e2e-testing v0.0.0-20240916050430-2e0921df7103
github.com/dymensionxyz/dymension/v3 v3.1.0-rc03.0.20240911123104-4782bc4e587f
github.com/dymensionxyz/dymint v1.2.0-rc01
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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-20240915121335-ddec1ae61af9 h1:nLpSvNKjfhl2oG3T0ZDGkg0V82B2KD6pCdHz89bAjM4=
github.com/decentrio/rollup-e2e-testing v0.0.0-20240915121335-ddec1ae61af9/go.mod h1:QmBrZgZplhtgHRWC0Z7LC7TDsKuC8sDyQvZyXXaqw/c=
github.com/decentrio/rollup-e2e-testing v0.0.0-20240916050430-2e0921df7103 h1:Oe4PR5yoyB1ALwi5CkN38M9VKHIIxWvvMbk/BORvMpQ=
github.com/decentrio/rollup-e2e-testing v0.0.0-20240916050430-2e0921df7103/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=
Expand Down
8 changes: 4 additions & 4 deletions tests/admc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ func TestADMC_Migrate_Empty_User_Memo_EVM(t *testing.T) {

resp, err := dymension.GetNode().QueryAllDenomMetadata(ctx)
require.NoError(t, err)
require.Equal(t, 2, len(resp.Metadatas))
require.Equal(t, 1, len(resp.Metadatas))

// Send a normal ibc tx from RA -> Hub
transferData := ibc.WalletData{
Expand Down Expand Up @@ -532,7 +532,7 @@ func TestADMC_Migrate_With_User_Memo_EVM(t *testing.T) {

resp, err := dymension.GetNode().QueryAllDenomMetadata(ctx)
require.NoError(t, err)
require.Equal(t, 2, len(resp.Metadatas))
require.Equal(t, 1, len(resp.Metadatas))

// Send a normal ibc tx from RA -> Hub
transferData := ibc.WalletData{
Expand Down Expand Up @@ -937,7 +937,7 @@ func TestADMC_Migrate_Empty_User_Memo_Wasm(t *testing.T) {

resp, err := dymension.GetNode().QueryAllDenomMetadata(ctx)
require.NoError(t, err)
require.Equal(t, 2, len(resp.Metadatas))
require.Equal(t, 1, len(resp.Metadatas))

// Send a normal ibc tx from RA -> Hub
transferData := ibc.WalletData{
Expand Down Expand Up @@ -1162,7 +1162,7 @@ func TestADMC_Migrate_With_User_Memo_Wasm(t *testing.T) {

resp, err := dymension.GetNode().QueryAllDenomMetadata(ctx)
require.NoError(t, err)
require.Equal(t, 2, len(resp.Metadatas))
require.Equal(t, 1, len(resp.Metadatas))

// Send a normal ibc tx from RA -> Hub
transferData := ibc.WalletData{
Expand Down
16 changes: 16 additions & 0 deletions tests/eibc_ack_error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,10 @@ func TestEIBC_AckError_RA_Token_EVM(t *testing.T) {
// market maker needs to have funds on the hub first to be able to fulfill upcoming demand order
err = dymension.Validators[0].SendFunds(ctx, "validator", transferData)
require.NoError(t, err)

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

testutil.AssertBalance(t, ctx, dymension, marketMakerAddr, rollappIBCDenom, transferAmount)
// end of preconditions

Expand Down Expand Up @@ -1098,6 +1102,10 @@ func TestEIBC_AckError_3rd_Party_Token_EVM(t *testing.T) {
// market maker needs to have funds on the hub first to be able to fulfill upcoming demand order
err = dymension.Validators[0].SendFunds(ctx, "validator", transferData)
require.NoError(t, err)

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

testutil.AssertBalance(t, ctx, dymension, marketMakerAddr, thirdPartyDenom, transferAmount)
// user from rollapp1 should have funds to be able to make the ibc transfer transaction
transferData = ibc.WalletData{
Expand Down Expand Up @@ -1888,6 +1896,10 @@ func TestEIBC_AckError_RA_Token_Wasm(t *testing.T) {
// market maker needs to have funds on the hub first to be able to fulfill upcoming demand order
err = dymension.Validators[0].SendFunds(ctx, "validator", transferData)
require.NoError(t, err)

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

testutil.AssertBalance(t, ctx, dymension, marketMakerAddr, rollappIBCDenom, transferAmount)
// end of preconditions

Expand Down Expand Up @@ -2253,6 +2265,10 @@ func TestEIBC_AckError_3rd_Party_Token_Wasm(t *testing.T) {
// market maker needs to have funds on the hub first to be able to fulfill upcoming demand order
err = dymension.Validators[0].SendFunds(ctx, "validator", transferData)
require.NoError(t, err)

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

testutil.AssertBalance(t, ctx, dymension, marketMakerAddr, thirdPartyDenom, transferAmount)
// user from rollapp1 should have funds to be able to make the ibc transfer transaction
transferData = ibc.WalletData{
Expand Down
16 changes: 12 additions & 4 deletions tests/eibc_feemarket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1918,7 +1918,7 @@ func TestEIBCUpdateOnTimeout_Unallowed_EVM(t *testing.T) {
require.NoError(t, err)

// get eibc event
eibcEvents, err := getEIbcEventsWithinBlockRange(ctx, dymension, 80, false)
eibcEvents, err := getEIbcEventsWithinBlockRange(ctx, dymension, 30, false)
require.NoError(t, err)
fmt.Println("Event:", eibcEvents)
require.Equal(t, eibcEvents[0].Price, fmt.Sprintf("%s%s", transferAmountWithoutFee, dymension.Config().Denom))
Expand Down Expand Up @@ -1959,11 +1959,19 @@ func TestEIBCUpdateOnTimeout_Unallowed_Wasm(t *testing.T) {
dymintTomlOverrides["settlement_gas_prices"] = "0adym"
dymintTomlOverrides["max_idle_time"] = "3s"
dymintTomlOverrides["max_proof_time"] = "500ms"
dymintTomlOverrides["batch_submit_time"] = "20s"
dymintTomlOverrides["batch_submit_time"] = "50s"
dymintTomlOverrides["p2p_blocksync_enabled"] = "false"

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

modifyGenesisKV := append(
dymensionGenesisKV,
cosmos.GenesisKV{
Key: "app_state.rollapp.params.dispute_period_in_blocks",
Value: fmt.Sprint(100),
},
)

// Create chain factory with dymension
numHubVals := 1
numHubFullNodes := 1
Expand Down Expand Up @@ -2009,7 +2017,7 @@ func TestEIBCUpdateOnTimeout_Unallowed_Wasm(t *testing.T) {
GasAdjustment: 1.1,
TrustingPeriod: "112h",
NoHostMount: false,
ModifyGenesis: modifyDymensionGenesis(dymensionGenesisKV),
ModifyGenesis: modifyDymensionGenesis(modifyGenesisKV),
ConfigFileOverrides: nil,
},
NumValidators: &numHubVals,
Expand Down Expand Up @@ -2141,7 +2149,7 @@ func TestEIBCUpdateOnTimeout_Unallowed_Wasm(t *testing.T) {
require.NoError(t, err)

// get eibc event
eibcEvents, err := getEIbcEventsWithinBlockRange(ctx, dymension, 30, false)
eibcEvents, err := getEIbcEventsWithinBlockRange(ctx, dymension, 50, false)
require.NoError(t, err)
fmt.Println("Event:", eibcEvents)
require.Equal(t, eibcEvents[0].Price, fmt.Sprintf("%s%s", transferAmountWithoutFee, dymension.Config().Denom))
Expand Down
12 changes: 10 additions & 2 deletions tests/eibc_fulfillment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1419,6 +1419,14 @@ func TestEIBCFulfillment_two_rollapps_EVM(t *testing.T) {
maxIdleTime2 := "1s"
configFileOverrides2 := overridesDymintToml(settlement_layer_rollapp2, settlement_node_address, rollapp2_id, gas_price_rollapp2, maxIdleTime2, maxProofTime, "50s")

modifyGenesisKV := append(
dymensionGenesisKV,
cosmos.GenesisKV{
Key: "app_state.rollapp.params.dispute_period_in_blocks",
Value: fmt.Sprint(100),
},
)

// Create chain factory with dymension
numHubVals := 1
numHubFullNodes := 1
Expand Down Expand Up @@ -1485,7 +1493,7 @@ func TestEIBCFulfillment_two_rollapps_EVM(t *testing.T) {
GasAdjustment: 1.1,
TrustingPeriod: "112h",
NoHostMount: false,
ModifyGenesis: modifyDymensionGenesis(dymensionGenesisKV),
ModifyGenesis: modifyDymensionGenesis(modifyGenesisKV),
ConfigFileOverrides: nil,
},
NumValidators: &numHubVals,
Expand Down Expand Up @@ -1709,7 +1717,7 @@ func TestEIBCFulfillment_two_rollapps_EVM(t *testing.T) {
require.Equal(t, "PENDING", eibcEvents[1].PacketStatus)

// fulfill demand order 2
txhash, err = dymension.FullfillDemandOrder(ctx, eibcEvents[len(eibcEvents)-2].OrderId, marketMakerAddr, eibcFee)
txhash, err = dymension.FullfillDemandOrder(ctx, eibcEvents[1].OrderId, marketMakerAddr, eibcFee)
require.NoError(t, err)
fmt.Println(txhash)
eibcEvent = getEibcEventFromTx(t, dymension, txhash)
Expand Down
2 changes: 1 addition & 1 deletion tests/eibc_invariant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func TestEIBCInvariant_EVM(t *testing.T) {
require.NoError(t, err)
require.True(t, isFinalized)

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

// Minus 0.1% of transfer amount for bridge fee
Expand Down
Loading

0 comments on commit c5269d3

Please sign in to comment.