Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anhductn2001 committed Dec 10, 2024
1 parent 1f1f951 commit 91de0e8
Show file tree
Hide file tree
Showing 31 changed files with 165 additions and 143 deletions.
8 changes: 0 additions & 8 deletions tests/admc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ func TestADMC_Originates_HubtoRA_EVM(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

//Update white listed relayers
Expand Down Expand Up @@ -319,7 +318,6 @@ func TestADMC_Migrate_Empty_User_Memo_EVM(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

//Update white listed relayers
Expand Down Expand Up @@ -598,7 +596,6 @@ func TestADMC_Migrate_With_User_Memo_EVM(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

//Update white listed relayers
Expand Down Expand Up @@ -883,7 +880,6 @@ func TestADMC_Originates_HubtoRA_Wasm(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

//Update white listed relayers
Expand Down Expand Up @@ -1084,7 +1080,6 @@ func TestADMC_Migrate_Empty_User_Memo_Wasm(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

//Update white listed relayers
Expand Down Expand Up @@ -1360,7 +1355,6 @@ func TestADMC_Migrate_With_User_Memo_Wasm(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

//Update white listed relayers
Expand Down Expand Up @@ -1670,7 +1664,6 @@ func TestADMC_MetaData_NotFound_EVM(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

//Update white listed relayers
Expand Down Expand Up @@ -1901,7 +1894,6 @@ func TestADMC_MetaData_NotFound_Wasm(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

//Update white listed relayers
Expand Down
25 changes: 9 additions & 16 deletions tests/automated_denommetadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ func TestADMC_Hub_to_RA_reserved_EVM(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

keyDir2 := dymension.GetRollApps()[1].GetSequencerKeyDir()
Expand All @@ -196,6 +195,9 @@ func TestADMC_Hub_to_RA_reserved_EVM(t *testing.T) {
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)

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

_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath2, []string{wallet2.FormattedAddress()})
require.NoError(t, err)

Expand Down Expand Up @@ -501,24 +503,13 @@ func TestADMC_Hub_to_RA_3rd_Party_EVM(t *testing.T) {
wallet1, found := r1.GetWallet(rollapp1.Config().ChainID)
require.True(t, found)

wallet2, found := r3.GetWallet(gaia.Config().ChainID)
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

keyDir2 := dymension.GetRollApps()[1].GetSequencerKeyDir()
require.NoError(t, err)
keyPath2 := keyDir2 + "/sequencer_keys"

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

_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath2, []string{wallet2.FormattedAddress()})
require.NoError(t, err)

CreateChannel(ctx, t, r1, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath)
CreateChannel(ctx, t, r3, eRep, dymension.CosmosChain, gaia, ibcPath)

Expand Down Expand Up @@ -837,7 +828,6 @@ func TestADMC_Hub_to_RA_reserved_Wasm(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

keyDir2 := dymension.GetRollApps()[1].GetSequencerKeyDir()
Expand All @@ -848,6 +838,9 @@ func TestADMC_Hub_to_RA_reserved_Wasm(t *testing.T) {
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)

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

_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath2, []string{wallet2.FormattedAddress()})
require.NoError(t, err)

Expand Down Expand Up @@ -1197,7 +1190,6 @@ func TestADMC_Hub_to_RA_3rd_Party_Wasm(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

keyDir2 := dymension.GetRollApps()[1].GetSequencerKeyDir()
Expand All @@ -1208,6 +1200,9 @@ func TestADMC_Hub_to_RA_3rd_Party_Wasm(t *testing.T) {
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)

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

_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath2, []string{wallet2.FormattedAddress()})
require.NoError(t, err)

Expand Down Expand Up @@ -1484,7 +1479,6 @@ func TestADMC_Hub_to_RA_Migrate_Dym_EVM(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

//Update white listed relayers
Expand Down Expand Up @@ -1708,7 +1702,6 @@ func TestADMC_Hub_to_RA_Migrate_Dym_Wasm(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

//Update white listed relayers
Expand Down
4 changes: 3 additions & 1 deletion tests/bridging_fee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,6 @@ func TestChangeBridgeFeeParam_EVM(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

keyDir2 := dymension.GetRollApps()[1].GetSequencerKeyDir()
Expand All @@ -329,6 +328,9 @@ func TestChangeBridgeFeeParam_EVM(t *testing.T) {
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)

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

_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath2, []string{wallet2.FormattedAddress()})
require.NoError(t, err)

Expand Down
1 change: 0 additions & 1 deletion tests/canonical_light_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ func TestIBCTransferRA_3rdSameChainID_EVM(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

//Update white listed relayers
Expand Down
24 changes: 18 additions & 6 deletions tests/eibc_ack_error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ func TestEIBC_AckError_Dym_EVM(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

keyDir2 := dymension.GetRollApps()[1].GetSequencerKeyDir()
Expand All @@ -191,6 +190,9 @@ func TestEIBC_AckError_Dym_EVM(t *testing.T) {
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)

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

_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath2, []string{wallet2.FormattedAddress()})
require.NoError(t, err)

Expand Down Expand Up @@ -686,7 +688,6 @@ func TestEIBC_AckError_RA_Token_EVM(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

keyDir2 := dymension.GetRollApps()[1].GetSequencerKeyDir()
Expand All @@ -697,6 +698,9 @@ func TestEIBC_AckError_RA_Token_EVM(t *testing.T) {
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)

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

_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath2, []string{wallet2.FormattedAddress()})
require.NoError(t, err)

Expand Down Expand Up @@ -1167,7 +1171,6 @@ func TestEIBC_AckError_3rd_Party_Token_EVM(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

keyDir2 := dymension.GetRollApps()[1].GetSequencerKeyDir()
Expand All @@ -1178,6 +1181,9 @@ func TestEIBC_AckError_3rd_Party_Token_EVM(t *testing.T) {
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)

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

_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath2, []string{wallet2.FormattedAddress()})
require.NoError(t, err)

Expand Down Expand Up @@ -1721,7 +1727,6 @@ func TestEIBC_AckError_Dym_Wasm(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

keyDir2 := dymension.GetRollApps()[1].GetSequencerKeyDir()
Expand All @@ -1732,6 +1737,9 @@ func TestEIBC_AckError_Dym_Wasm(t *testing.T) {
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)

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

_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath2, []string{wallet2.FormattedAddress()})
require.NoError(t, err)

Expand Down Expand Up @@ -2219,7 +2227,6 @@ func TestEIBC_AckError_RA_Token_Wasm(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

keyDir2 := dymension.GetRollApps()[1].GetSequencerKeyDir()
Expand All @@ -2230,6 +2237,9 @@ func TestEIBC_AckError_RA_Token_Wasm(t *testing.T) {
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)

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

_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath2, []string{wallet2.FormattedAddress()})
require.NoError(t, err)

Expand Down Expand Up @@ -2698,7 +2708,6 @@ func TestEIBC_AckError_3rd_Party_Token_Wasm(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

keyDir2 := dymension.GetRollApps()[1].GetSequencerKeyDir()
Expand All @@ -2709,6 +2718,9 @@ func TestEIBC_AckError_3rd_Party_Token_Wasm(t *testing.T) {
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)

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

_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath2, []string{wallet2.FormattedAddress()})
require.NoError(t, err)

Expand Down
2 changes: 0 additions & 2 deletions tests/eibc_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ func Test_EIBC_Client_Success_EVM(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

//Update white listed relayers
Expand Down Expand Up @@ -973,7 +972,6 @@ func Test_EIBC_Client_NoFulfillRollapp_EVM(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

//Update white listed relayers
Expand Down
1 change: 0 additions & 1 deletion tests/eibc_corrupted_memo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ func TestEIBCCorruptedMemoNegative_EVM(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

//Update white listed relayers
Expand Down
16 changes: 12 additions & 4 deletions tests/eibc_fee_market_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ func TestEIBCFulfillAlreadyFulfilledDemand_EVM(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

keyDir2 := dymension.GetRollApps()[1].GetSequencerKeyDir()
Expand All @@ -173,6 +172,9 @@ func TestEIBCFulfillAlreadyFulfilledDemand_EVM(t *testing.T) {
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)

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

_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath2, []string{wallet2.FormattedAddress()})
require.NoError(t, err)

Expand Down Expand Up @@ -556,7 +558,6 @@ func TestEIBCAlreadyFulfilledDemand_Wasm(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

keyDir2 := dymension.GetRollApps()[1].GetSequencerKeyDir()
Expand All @@ -567,6 +568,9 @@ func TestEIBCAlreadyFulfilledDemand_Wasm(t *testing.T) {
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)

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

_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath2, []string{wallet2.FormattedAddress()})
require.NoError(t, err)

Expand Down Expand Up @@ -950,7 +954,6 @@ func TestEIBCUnallowedSigner_EVM(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

keyDir2 := dymension.GetRollApps()[1].GetSequencerKeyDir()
Expand All @@ -961,6 +964,9 @@ func TestEIBCUnallowedSigner_EVM(t *testing.T) {
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)

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

_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath2, []string{wallet2.FormattedAddress()})
require.NoError(t, err)

Expand Down Expand Up @@ -1252,7 +1258,6 @@ func TestEIBCUnallowedSigner_Wasm(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

keyDir2 := dymension.GetRollApps()[1].GetSequencerKeyDir()
Expand All @@ -1263,6 +1268,9 @@ func TestEIBCUnallowedSigner_Wasm(t *testing.T) {
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet1.FormattedAddress()})
require.NoError(t, err)

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

_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath2, []string{wallet2.FormattedAddress()})
require.NoError(t, err)

Expand Down
1 change: 0 additions & 1 deletion tests/eibc_fee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ func TestEIBCFeeTooHigh_EVM(t *testing.T) {
require.True(t, found)

keyDir := dymension.GetRollApps()[0].GetSequencerKeyDir()
require.NoError(t, err)
keyPath := keyDir + "/sequencer_keys"

//Update white listed relayers
Expand Down
Loading

0 comments on commit 91de0e8

Please sign in to comment.