Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] fix ibc transfer timeout #613

Merged
merged 5 commits into from
Jan 20, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
minor
  • Loading branch information
ThanhNhann committed Jan 14, 2025
commit 2795ea3a11569bc348f0257860dcfe4a404f60b6
29 changes: 7 additions & 22 deletions tests/ibc_timeout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"strconv"
"testing"
"time"

transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"

Expand Down Expand Up @@ -141,18 +140,11 @@ func TestIBCTransferTimeout_EVM(t *testing.T) {
require.NoError(t, err)

//Update white listed relayers
for i := 0; i < 10; i++ {
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet.FormattedAddress()})
if err != nil {
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet.FormattedAddress()})
if err == nil {
break
}
if i == 9 {
fmt.Println("Max retries reached. Exiting...")
break
}
time.Sleep(5 * time.Second)
require.NoError(t, err)
}
require.NoError(t, err)

CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath)

Expand Down Expand Up @@ -266,7 +258,7 @@ func TestIBCTransferTimeout_EVM(t *testing.T) {

balance := zeroBal
// Assert funds were returned to the sender after the timeout has occured
for i:=1; i<30; i++ {
for i := 1; i < 30; i++ {
balance, err = rollapp1.GetBalance(ctx, rollappUserAddr, rollapp1.Config().Denom)
require.NoError(t, err)
if walletAmount.Sub(transferData.Amount).String() == balance.String() {
Expand Down Expand Up @@ -474,18 +466,11 @@ func TestIBCTransferTimeout_Wasm(t *testing.T) {
require.NoError(t, err)

//Update white listed relayers
for i := 0; i < 10; i++ {
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet.FormattedAddress()})
if err != nil {
_, err = dymension.GetNode().UpdateWhitelistedRelayers(ctx, "sequencer", keyPath, []string{wallet.FormattedAddress()})
if err == nil {
break
}
if i == 9 {
fmt.Println("Max retries reached. Exiting...")
break
}
time.Sleep(5 * time.Second)
require.NoError(t, err)
}
require.NoError(t, err)

CreateChannel(ctx, t, r, eRep, dymension.CosmosChain, rollapp1.CosmosChain, ibcPath)

Expand Down