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 all commits
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
17 changes: 9 additions & 8 deletions tests/ibc_timeout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,17 +223,18 @@ func TestIBCTransferTimeout_EVM(t *testing.T) {
// Set a short timeout for IBC transfer
options := ibc.TransferOptions{
Timeout: &ibc.IBCTimeout{
NanoSeconds: 100000, // 1 ms - this will cause the transfer to timeout before it is picked by a relayer
NanoSeconds: 1, // 1 ns - this will cause the transfer to timeout before it is picked by a relayer
},
}

// Compose an IBC transfer and send from Rollapp -> Hub
_, err = rollapp1.SendIBCTransfer(ctx, channel.ChannelID, rollappUserAddr, transferData, options)
require.NoError(t, err)

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

time.Sleep(time.Nanosecond * 1)
// err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1)
// require.NoError(t, err)

rollappHeight, err = rollapp1.GetNode().Height(ctx)
require.NoError(t, err)

Expand Down Expand Up @@ -553,7 +554,7 @@ func TestIBCTransferTimeout_Wasm(t *testing.T) {
// Set a short timeout for IBC transfer
options := ibc.TransferOptions{
Timeout: &ibc.IBCTimeout{
NanoSeconds: 100000, // 1 ms - this will cause the transfer to timeout before it is picked by a relayer
NanoSeconds: 1, // 1 ns - this will cause the transfer to timeout before it is picked by a relayer
},
}

Expand All @@ -563,8 +564,9 @@ func TestIBCTransferTimeout_Wasm(t *testing.T) {
// Assert balance was updated on the rollapp
testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferData.Amount).Sub(transferData.Amount))

err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1)
require.NoError(t, err)
time.Sleep(time.Nanosecond * 1)
// err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1)
// require.NoError(t, err)

rollappHeight, err = rollapp1.GetNode().Height(ctx)
require.NoError(t, err)
Expand All @@ -589,7 +591,6 @@ func TestIBCTransferTimeout_Wasm(t *testing.T) {

fmt.Println(txhash)
}

// Get the IBC denom for urax on Hub
rollappTokenDenom := transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, rollapp1.Config().Denom)
rollappIBCDenom := transfertypes.ParseDenomTrace(rollappTokenDenom).IBCDenom()
Expand Down
Loading