Skip to content

Commit

Permalink
Fix tests (#550)
Browse files Browse the repository at this point in the history
Co-authored-by: hungdinh82 <[email protected]>
  • Loading branch information
anhductn2001 and hungdinh82 authored Dec 16, 2024
1 parent 04e6287 commit 673219e
Show file tree
Hide file tree
Showing 32 changed files with 396 additions and 52 deletions.
24 changes: 24 additions & 0 deletions tests/admc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ func TestADMC_Originates_HubtoRA_EVM(t *testing.T) {
keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
keyPath := keyDir + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -320,6 +323,9 @@ func TestADMC_Migrate_Empty_User_Memo_EVM(t *testing.T) {
keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
keyPath := keyDir + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -598,6 +604,9 @@ func TestADMC_Migrate_With_User_Memo_EVM(t *testing.T) {
keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
keyPath := keyDir + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -882,6 +891,9 @@ func TestADMC_Originates_HubtoRA_Wasm(t *testing.T) {
keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
keyPath := keyDir + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -1082,6 +1094,9 @@ func TestADMC_Migrate_Empty_User_Memo_Wasm(t *testing.T) {
keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
keyPath := keyDir + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -1357,6 +1372,9 @@ func TestADMC_Migrate_With_User_Memo_Wasm(t *testing.T) {
keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
keyPath := keyDir + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -1666,6 +1684,9 @@ func TestADMC_MetaData_NotFound_EVM(t *testing.T) {
keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
keyPath := keyDir + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -1896,6 +1917,9 @@ func TestADMC_MetaData_NotFound_Wasm(t *testing.T) {
keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
keyPath := keyDir + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet.FormattedAddress()})
require.NoError(t, err)
Expand Down
18 changes: 18 additions & 0 deletions tests/automated_denommetadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ func TestADMC_Hub_to_RA_reserved_EVM(t *testing.T) {
require.NoError(t, err)
keyPath2 := keyDir2 + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -506,6 +509,9 @@ func TestADMC_Hub_to_RA_3rd_Party_EVM(t *testing.T) {
keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
keyPath := keyDir + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -834,6 +840,9 @@ func TestADMC_Hub_to_RA_reserved_Wasm(t *testing.T) {
require.NoError(t, err)
keyPath2 := keyDir2 + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -1196,6 +1205,9 @@ func TestADMC_Hub_to_RA_3rd_Party_Wasm(t *testing.T) {
require.NoError(t, err)
keyPath2 := keyDir2 + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -1481,6 +1493,9 @@ func TestADMC_Hub_to_RA_Migrate_Dym_EVM(t *testing.T) {
keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
keyPath := keyDir + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -1704,6 +1719,9 @@ func TestADMC_Hub_to_RA_Migrate_Dym_Wasm(t *testing.T) {
keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
keyPath := keyDir + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet.FormattedAddress()})
require.NoError(t, err)
Expand Down
3 changes: 3 additions & 0 deletions tests/bridging_fee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,9 @@ func TestChangeBridgeFeeParam_EVM(t *testing.T) {
require.NoError(t, err)
keyPath2 := keyDir2 + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)
Expand Down
3 changes: 3 additions & 0 deletions tests/canonical_light_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,9 @@ func TestIBCTransferRA_3rdSameChainID_EVM(t *testing.T) {
keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
keyPath := keyDir + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet.FormattedAddress()})
require.NoError(t, err)
Expand Down
21 changes: 21 additions & 0 deletions tests/eibc_ack_error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ func TestEIBC_AckError_Dym_EVM(t *testing.T) {
require.NoError(t, err)
keyPath2 := keyDir2 + "/sequencer_keys"

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

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -694,6 +700,9 @@ func TestEIBC_AckError_RA_Token_EVM(t *testing.T) {
require.NoError(t, err)
keyPath2 := keyDir2 + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -1177,6 +1186,9 @@ func TestEIBC_AckError_3rd_Party_Token_EVM(t *testing.T) {
require.NoError(t, err)
keyPath2 := keyDir2 + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -1733,6 +1745,9 @@ func TestEIBC_AckError_Dym_Wasm(t *testing.T) {
require.NoError(t, err)
keyPath2 := keyDir2 + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -2237,6 +2252,9 @@ func TestEIBC_AckError_RA_Token_Wasm(t *testing.T) {
require.NoError(t, err)
keyPath2 := keyDir2 + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -2718,6 +2736,9 @@ func TestEIBC_AckError_3rd_Party_Token_Wasm(t *testing.T) {
require.NoError(t, err)
keyPath2 := keyDir2 + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)
Expand Down
6 changes: 6 additions & 0 deletions tests/eibc_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,9 @@ func Test_EIBC_Client_Success_EVM(t *testing.T) {
keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
keyPath := keyDir + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -974,6 +977,9 @@ func Test_EIBC_Client_NoFulfillRollapp_EVM(t *testing.T) {
keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
keyPath := keyDir + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet.FormattedAddress()})
require.NoError(t, err)
Expand Down
3 changes: 3 additions & 0 deletions tests/eibc_corrupted_memo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ func TestEIBCCorruptedMemoNegative_EVM(t *testing.T) {
keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
keyPath := keyDir + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet.FormattedAddress()})
require.NoError(t, err)
Expand Down
12 changes: 12 additions & 0 deletions tests/eibc_fee_market_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ func TestEIBCFulfillAlreadyFulfilledDemand_EVM(t *testing.T) {
require.NoError(t, err)
keyPath2 := keyDir2 + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -564,6 +567,9 @@ func TestEIBCAlreadyFulfilledDemand_Wasm(t *testing.T) {
require.NoError(t, err)
keyPath2 := keyDir2 + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -960,6 +966,9 @@ func TestEIBCUnallowedSigner_EVM(t *testing.T) {
require.NoError(t, err)
keyPath2 := keyDir2 + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -1264,6 +1273,9 @@ func TestEIBCUnallowedSigner_Wasm(t *testing.T) {
require.NoError(t, err)
keyPath2 := keyDir2 + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)
Expand Down
3 changes: 3 additions & 0 deletions tests/eibc_fee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ func TestEIBCFeeTooHigh_EVM(t *testing.T) {
keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
keyPath := keyDir + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet.FormattedAddress()})
require.NoError(t, err)
Expand Down
24 changes: 24 additions & 0 deletions tests/eibc_feemarket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ func TestEIBC_Fee_Market_Success_EVM(t *testing.T) {
require.NoError(t, err)
keyPath2 := keyDir2 + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -531,6 +534,9 @@ func TestEIBC_Fee_Market_Success_Wasm(t *testing.T) {
require.NoError(t, err)
keyPath2 := keyDir2 + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -896,6 +902,9 @@ func TestEIBC_Fee_Market_Auto_Created_EVM(t *testing.T) {
require.NoError(t, err)
keyPath2 := keyDir2 + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -1245,6 +1254,9 @@ func TestEIBC_Fee_Market_Auto_Created_Wasm(t *testing.T) {
require.NoError(t, err)
keyPath2 := keyDir2 + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -1555,6 +1567,9 @@ func TestEIBCUpdateOnAckErrAndTimeout_EVM(t *testing.T) {
keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
keyPath := keyDir + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -1835,6 +1850,9 @@ func TestEIBCUpdateOnAckErrAndTimeout_Wasm(t *testing.T) {
keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
keyPath := keyDir + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -2137,6 +2155,9 @@ func TestEIBCUpdateOnTimeout_Unallowed_EVM(t *testing.T) {
keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
keyPath := keyDir + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet.FormattedAddress()})
require.NoError(t, err)
Expand Down Expand Up @@ -2387,6 +2408,9 @@ func TestEIBCUpdateOnTimeout_Unallowed_Wasm(t *testing.T) {
keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
keyPath := keyDir + "/sequencer_keys"

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

//Update white listed relayers
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet.FormattedAddress()})
require.NoError(t, err)
Expand Down
Loading

0 comments on commit 673219e

Please sign in to comment.