From 7af97f8f25b9cceaebc5cfc14b861ef82b5721bb Mon Sep 17 00:00:00 2001 From: anhductn2001 Date: Mon, 16 Sep 2024 16:37:32 +0700 Subject: [PATCH 1/3] fix ack_err tests --- tests/eibc_ack_error_test.go | 122 +++++++++++++++++++++++---------- tests/eibc_feemarket_test.go | 12 +++- tests/eibc_fulfillment_test.go | 1 - tests/ibc_timeout_test.go | 8 +-- 4 files changed, 101 insertions(+), 42 deletions(-) diff --git a/tests/eibc_ack_error_test.go b/tests/eibc_ack_error_test.go index 384680ea..1450e29d 100644 --- a/tests/eibc_ack_error_test.go +++ b/tests/eibc_ack_error_test.go @@ -296,17 +296,6 @@ func TestEIBC_AckError_Dym_EVM(t *testing.T) { err = testutil.WaitForBlocks(ctx, 3, dymension, rollapp1) require.NoError(t, err) - rollappHeight, err := rollapp1.GetNode().Height(ctx) - require.NoError(t, err) - - // wait until the packet is finalized - isFinalized, err := dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp1.GetChainID(), rollappHeight, 300) - require.NoError(t, err) - require.True(t, isFinalized) - - err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) - require.NoError(t, err) - testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, walletAmount.Sub(transferData.Amount)) erc20MAcc, err := rollapp1.Validators[0].QueryModuleAccount(ctx, "erc20") require.NoError(t, err) @@ -672,6 +661,26 @@ func TestEIBC_AckError_RA_Token_EVM(t *testing.T) { require.NoError(t, err) require.True(t, isFinalized) + valAddr, err := dymension.Validators[0].AccountKeyBech32(ctx, "validator") + require.NoError(t, err) + + transferData = ibc.WalletData{ + Address: valAddr, + Denom: rollapp1.Config().Denom, + Amount: bigTransferAmount, + } + + _, err = rollapp1.SendIBCTransfer(ctx, channRollApp1Dym.ChannelID, rollappUserAddr, transferData, ibc.TransferOptions{}) + require.NoError(t, err) + + rollappHeight, err = rollapp1.GetNode().Height(ctx) + require.NoError(t, err) + + // wait until the packet is finalized + isFinalized, err = dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp1.GetChainID(), rollappHeight, 300) + require.NoError(t, err) + require.True(t, isFinalized) + err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) require.NoError(t, err) @@ -692,9 +701,8 @@ func TestEIBC_AckError_RA_Token_EVM(t *testing.T) { require.NoError(t, err) testutil.AssertBalance(t, ctx, dymension, marketMakerAddr, rollappIBCDenom, transferAmount) - // end of preconditions - // + // end of preconditions // prop to disable ibc transfer on rollapp receiveEnableParams := json.RawMessage(`false`) _, err = dymension.GetNode().ParamChangeProposal(ctx, dymensionUser.KeyName(), @@ -1047,6 +1055,29 @@ func TestEIBC_AckError_3rd_Party_Token_EVM(t *testing.T) { err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) require.NoError(t, err) + valAddr, err := dymension.Validators[0].AccountKeyBech32(ctx, "validator") + require.NoError(t, err) + + transferData = ibc.WalletData{ + Address: valAddr, + Denom: rollapp2.Config().Denom, + Amount: bigTransferAmount, + } + + _, err = rollapp2.SendIBCTransfer(ctx, channRollApp2Dym.ChannelID, rollapp2UserAddr, transferData, ibc.TransferOptions{}) + require.NoError(t, err) + + rollappHeight, err = rollapp2.GetNode().Height(ctx) + require.NoError(t, err) + + // wait until the packet is finalized + isFinalized, err = dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp2.GetChainID(), rollappHeight, 300) + require.NoError(t, err) + require.True(t, isFinalized) + + err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) + require.NoError(t, err) + var options ibc.TransferOptions // register ibc denom on rollapp1 @@ -1120,17 +1151,6 @@ func TestEIBC_AckError_3rd_Party_Token_EVM(t *testing.T) { err = testutil.WaitForBlocks(ctx, 3, dymension, rollapp1) require.NoError(t, err) - rollappHeight, err := rollapp1.GetNode().Height(ctx) - require.NoError(t, err) - - // wait until the packet is finalized - isFinalized, err := dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp1.GetChainID(), rollappHeight, 300) - require.NoError(t, err) - require.True(t, isFinalized) - - err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) - require.NoError(t, err) - erc20MAcc, err := rollapp1.Validators[0].QueryModuleAccount(ctx, "erc20") require.NoError(t, err) erc20MAccAddr := erc20MAcc.Account.BaseAccount.Address @@ -1517,17 +1537,6 @@ func TestEIBC_AckError_Dym_Wasm(t *testing.T) { err = testutil.WaitForBlocks(ctx, 3, dymension, rollapp1) require.NoError(t, err) - rollappHeight, err := rollapp1.GetNode().Height(ctx) - require.NoError(t, err) - - // wait until the packet is finalized - isFinalized, err := dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp1.GetChainID(), rollappHeight, 300) - require.NoError(t, err) - require.True(t, isFinalized) - - err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) - require.NoError(t, err) - testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, walletAmount.Sub(transferData.Amount)) testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, dymensionIBCDenom, transferAmount) @@ -1881,6 +1890,26 @@ func TestEIBC_AckError_RA_Token_Wasm(t *testing.T) { require.NoError(t, err) require.True(t, isFinalized) + valAddr, err := dymension.Validators[0].AccountKeyBech32(ctx, "validator") + require.NoError(t, err) + + transferData = ibc.WalletData{ + Address: valAddr, + Denom: rollapp1.Config().Denom, + Amount: bigTransferAmount, + } + + _, err = rollapp1.SendIBCTransfer(ctx, channRollApp1Dym.ChannelID, rollappUserAddr, transferData, ibc.TransferOptions{}) + require.NoError(t, err) + + rollappHeight, err = rollapp1.GetNode().Height(ctx) + require.NoError(t, err) + + // wait until the packet is finalized + isFinalized, err = dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp1.GetChainID(), rollappHeight, 300) + require.NoError(t, err) + require.True(t, isFinalized) + err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) require.NoError(t, err) @@ -2253,6 +2282,29 @@ func TestEIBC_AckError_3rd_Party_Token_Wasm(t *testing.T) { err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) require.NoError(t, err) + valAddr, err := dymension.Validators[0].AccountKeyBech32(ctx, "validator") + require.NoError(t, err) + + transferData = ibc.WalletData{ + Address: valAddr, + Denom: rollapp2.Config().Denom, + Amount: bigTransferAmount, + } + + _, err = rollapp2.SendIBCTransfer(ctx, channRollApp2Dym.ChannelID, rollapp2UserAddr, transferData, ibc.TransferOptions{}) + require.NoError(t, err) + + rollappHeight, err = rollapp2.GetNode().Height(ctx) + require.NoError(t, err) + + // wait until the packet is finalized + isFinalized, err = dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp2.GetChainID(), rollappHeight, 300) + require.NoError(t, err) + require.True(t, isFinalized) + + err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) + require.NoError(t, err) + var options ibc.TransferOptions t.Run("Demand order is created upon AckError for rollapp token", func(t *testing.T) { diff --git a/tests/eibc_feemarket_test.go b/tests/eibc_feemarket_test.go index 284dae77..4f70b8c8 100644 --- a/tests/eibc_feemarket_test.go +++ b/tests/eibc_feemarket_test.go @@ -1402,7 +1402,7 @@ func TestEIBCUpdateOnAckErrAndTimeout_EVM(t *testing.T) { require.NoError(t, err) // get eibc event - eibcEvents, err := getEIbcEventsWithinBlockRange(ctx, dymension, 70, false) + eibcEvents, err := getEIbcEventsWithinBlockRange(ctx, dymension, 50, false) require.NoError(t, err) fmt.Println(eibcEvents) require.Equal(t, eibcEvents[0].Price, fmt.Sprintf("%s%s", transferAmountWithoutFee, dymension.Config().Denom)) @@ -1472,6 +1472,14 @@ func TestEIBCUpdateOnAckErrAndTimeout_Wasm(t *testing.T) { 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 @@ -1517,7 +1525,7 @@ func TestEIBCUpdateOnAckErrAndTimeout_Wasm(t *testing.T) { GasAdjustment: 1.1, TrustingPeriod: "112h", NoHostMount: false, - ModifyGenesis: modifyDymensionGenesis(dymensionGenesisKV), + ModifyGenesis: modifyDymensionGenesis(modifyGenesisKV), ConfigFileOverrides: nil, }, NumValidators: &numHubVals, diff --git a/tests/eibc_fulfillment_test.go b/tests/eibc_fulfillment_test.go index 8631f8fd..7a179231 100644 --- a/tests/eibc_fulfillment_test.go +++ b/tests/eibc_fulfillment_test.go @@ -1750,7 +1750,6 @@ func TestEIBCFulfillment_two_rollapps_EVM(t *testing.T) { balance, err = dymension.GetBalance(ctx, marketMakerAddr, rollapp2IBCDenom) require.NoError(t, err) fmt.Println("Balance of marketMakerAddr after fulfilling the order:", balance) - expMmBalanceRollappDenom = expMmBalanceRollappDenom.Add(transferAmount).Sub(bridgingFee) require.True(t, balance.Equal(expMmBalanceRollappDenom), fmt.Sprintf("Value mismatch. Expected %s, actual %s", expMmBalanceRollappDenom, balance)) t.Cleanup( diff --git a/tests/ibc_timeout_test.go b/tests/ibc_timeout_test.go index 42fcd539..b84a4929 100644 --- a/tests/ibc_timeout_test.go +++ b/tests/ibc_timeout_test.go @@ -205,7 +205,7 @@ func TestIBCTransferTimeout_EVM(t *testing.T) { rollappTokenDenom := transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, rollapp1.Config().Denom) rollappIBCDenom := transfertypes.ParseDenomTrace(rollappTokenDenom).IBCDenom() - err = testutil.WaitForBlocks(ctx, 100, dymension, rollapp1) + err = testutil.WaitForBlocks(ctx, 150, dymension, rollapp1) require.NoError(t, err) // Assert funds were returned to the sender after the timeout has occured @@ -244,7 +244,7 @@ func TestIBCTransferTimeout_EVM(t *testing.T) { require.NoError(t, err) require.True(t, isFinalized) - err = testutil.WaitForBlocks(ctx, 100, dymension, rollapp1) + err = testutil.WaitForBlocks(ctx, 150, dymension, rollapp1) require.NoError(t, err) // Assert funds were returned to the sender after the timeout has occured @@ -445,7 +445,7 @@ func TestIBCTransferTimeout_Wasm(t *testing.T) { rollappTokenDenom := transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, rollapp1.Config().Denom) rollappIBCDenom := transfertypes.ParseDenomTrace(rollappTokenDenom).IBCDenom() - err = testutil.WaitForBlocks(ctx, 100, dymension, rollapp1) + err = testutil.WaitForBlocks(ctx, 150, dymension, rollapp1) require.NoError(t, err) // Assert funds were returned to the sender after the timeout has occured @@ -484,7 +484,7 @@ func TestIBCTransferTimeout_Wasm(t *testing.T) { require.NoError(t, err) require.True(t, isFinalized) - err = testutil.WaitForBlocks(ctx, 100, dymension, rollapp1) + err = testutil.WaitForBlocks(ctx, 150, dymension, rollapp1) require.NoError(t, err) // Assert funds were returned to the sender after the timeout has occured From 970cd4a6d50ffb6154430e0494c5c5d4d1e6f609 Mon Sep 17 00:00:00 2001 From: anhductn2001 Date: Mon, 16 Sep 2024 17:25:43 +0700 Subject: [PATCH 2/3] fix ack_err tests --- tests/eibc_ack_error_test.go | 4 ++-- tests/eibc_feemarket_test.go | 4 ++-- tests/eibc_fulfillment_test.go | 25 +++++++------------------ tests/eibc_not_fulfillment_test.go | 2 +- tests/eibc_timeout_test.go | 2 +- 5 files changed, 13 insertions(+), 24 deletions(-) diff --git a/tests/eibc_ack_error_test.go b/tests/eibc_ack_error_test.go index 1450e29d..3143eccb 100644 --- a/tests/eibc_ack_error_test.go +++ b/tests/eibc_ack_error_test.go @@ -754,7 +754,7 @@ func TestEIBC_AckError_RA_Token_EVM(t *testing.T) { require.True(t, bytes.Contains(ack.Acknowledgement, []byte("error"))) // We transfered once to enable ibc-transfer from dym to rollapp - testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferData.Amount)) + testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferData.Amount).Sub(bigTransferAmount)) // At the moment, the ack returned and the demand order status became "finalized" // We will execute the ibc transfer again and try to fulfill the demand order @@ -1981,7 +1981,7 @@ func TestEIBC_AckError_RA_Token_Wasm(t *testing.T) { require.True(t, bytes.Contains(ack.Acknowledgement, []byte("error"))) // We transfered once to enable ibc-transfer from dym to rollapp - testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferData.Amount)) + testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferData.Amount).Sub(bigTransferAmount)) // At the moment, the ack returned and the demand order status became "finalized" // We will execute the ibc transfer again and try to fulfill the demand order diff --git a/tests/eibc_feemarket_test.go b/tests/eibc_feemarket_test.go index 4f70b8c8..91cd28eb 100644 --- a/tests/eibc_feemarket_test.go +++ b/tests/eibc_feemarket_test.go @@ -1402,7 +1402,7 @@ func TestEIBCUpdateOnAckErrAndTimeout_EVM(t *testing.T) { require.NoError(t, err) // get eibc event - eibcEvents, err := getEIbcEventsWithinBlockRange(ctx, dymension, 50, false) + eibcEvents, err := getEIbcEventsWithinBlockRange(ctx, dymension, 30, false) require.NoError(t, err) fmt.Println(eibcEvents) require.Equal(t, eibcEvents[0].Price, fmt.Sprintf("%s%s", transferAmountWithoutFee, dymension.Config().Denom)) @@ -1660,7 +1660,7 @@ func TestEIBCUpdateOnAckErrAndTimeout_Wasm(t *testing.T) { require.NoError(t, err) // get eibc event - eibcEvents, err := getEIbcEventsWithinBlockRange(ctx, dymension, 50, 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)) diff --git a/tests/eibc_fulfillment_test.go b/tests/eibc_fulfillment_test.go index 7a179231..65dc172f 100644 --- a/tests/eibc_fulfillment_test.go +++ b/tests/eibc_fulfillment_test.go @@ -1688,20 +1688,6 @@ func TestEIBCFulfillment_two_rollapps_EVM(t *testing.T) { fmt.Println("Balance of dymensionUserAddr right after sending eIBC transfer from rollapp 2 to dym hub:", balance) require.True(t, balance.Equal(zeroBalance), fmt.Sprintf("Value mismatch. Expected %s, actual %s", zeroBalance, balance)) - // get eIbc event - eibcEvents, err := getEIbcEventsWithinBlockRange(ctx, dymension, 30, false) - require.NoError(t, err) - require.Equal(t, eibcEvents[len(eibcEvents)-1].PacketStatus, "PENDING") - - // fulfill demand order 1 - txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[len(eibcEvents)-1].OrderId, marketMakerAddr, eibcFee) - require.NoError(t, err) - fmt.Println(txhash) - eibcEvent := getEibcEventFromTx(t, dymension, txhash) - if eibcEvent != nil { - fmt.Println("After order fulfillment:", eibcEvent) - } - _, err = rollapp1.SendIBCTransfer(ctx, dymChannel_ra1[0].ChannelID, rollappUserAddr, transferDataRollapp1, options) require.NoError(t, err) @@ -1711,16 +1697,19 @@ func TestEIBCFulfillment_two_rollapps_EVM(t *testing.T) { require.True(t, balance.Equal(zeroBalance), fmt.Sprintf("Value mismatch. Expected %s, actual %s", zeroBalance, balance)) // get eIbc event - eibcEvents, err = getEIbcEventsWithinBlockRange(ctx, dymension, 50, false) + eibcEvents, err := getEIbcEventsWithinBlockRange(ctx, dymension, 50, false) fmt.Println(eibcEvents) require.NoError(t, err) + require.Equal(t, "PENDING", eibcEvents[0].PacketStatus) require.Equal(t, "PENDING", eibcEvents[1].PacketStatus) // fulfill demand order 2 - txhash, err = dymension.FullfillDemandOrder(ctx, eibcEvents[1].OrderId, marketMakerAddr, eibcFee) + _, err = dymension.FullfillDemandOrder(ctx, eibcEvents[1].OrderId, marketMakerAddr, eibcFee) require.NoError(t, err) - fmt.Println(txhash) - eibcEvent = getEibcEventFromTx(t, dymension, txhash) + txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[0].OrderId, marketMakerAddr, eibcFee) + require.NoError(t, err) + + eibcEvent := getEibcEventFromTx(t, dymension, txhash) if eibcEvent != nil { fmt.Println("After order fulfillment:", eibcEvent) } diff --git a/tests/eibc_not_fulfillment_test.go b/tests/eibc_not_fulfillment_test.go index 7bf718fd..dbfe365e 100644 --- a/tests/eibc_not_fulfillment_test.go +++ b/tests/eibc_not_fulfillment_test.go @@ -512,7 +512,7 @@ func TestEIBCNotFulfillment_Wasm(t *testing.T) { require.NoError(t, err) require.True(t, isFinalized) - err = testutil.WaitForBlocks(ctx, 10, dymension, rollapp1) + err = testutil.WaitForBlocks(ctx, 30, dymension, rollapp1) require.NoError(t, err) // Get the IBC denom for urax on Hub diff --git a/tests/eibc_timeout_test.go b/tests/eibc_timeout_test.go index 2eca490c..12df0e0d 100644 --- a/tests/eibc_timeout_test.go +++ b/tests/eibc_timeout_test.go @@ -619,7 +619,7 @@ func TestEIBCTimeoutFulFillDymToRollapp_EVM(t *testing.T) { require.NoError(t, err) // get eibc event - eibcEvents, err := getEIbcEventsWithinBlockRange(ctx, dymension, 80, false) + eibcEvents, err := getEIbcEventsWithinBlockRange(ctx, dymension, 50, false) require.NoError(t, err) fmt.Println("Event:", eibcEvents[0]) require.Equal(t, eibcEvents[0].Price, fmt.Sprintf("%s%s", transferAmountWithoutFee, gaiaIBCDenom)) From bd26f43d5ab69a81e19a1d5a070631e60702cbac Mon Sep 17 00:00:00 2001 From: anhductn2001 Date: Mon, 16 Sep 2024 19:02:51 +0700 Subject: [PATCH 3/3] fix ack_err tests --- tests/eibc_ack_error_test.go | 4 ++-- tests/eibc_feemarket_test.go | 8 ++++---- tests/ibc_timeout_test.go | 12 ------------ 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/tests/eibc_ack_error_test.go b/tests/eibc_ack_error_test.go index 3143eccb..e582f66f 100644 --- a/tests/eibc_ack_error_test.go +++ b/tests/eibc_ack_error_test.go @@ -809,7 +809,7 @@ func TestEIBC_AckError_RA_Token_EVM(t *testing.T) { // wait for a few blocks and check if the fund returns to rollapp testutil.WaitForBlocks(ctx, 20, rollapp1) - testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferAmount)) + testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferAmount).Sub(bigTransferAmount)) }) } @@ -2036,7 +2036,7 @@ func TestEIBC_AckError_RA_Token_Wasm(t *testing.T) { // wait for a few blocks and check if the fund returns to rollapp testutil.WaitForBlocks(ctx, 20, rollapp1) - testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferAmount)) + testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferAmount).Sub(bigTransferAmount)) }) } diff --git a/tests/eibc_feemarket_test.go b/tests/eibc_feemarket_test.go index 91cd28eb..522f2332 100644 --- a/tests/eibc_feemarket_test.go +++ b/tests/eibc_feemarket_test.go @@ -1437,7 +1437,7 @@ func TestEIBCUpdateOnAckErrAndTimeout_EVM(t *testing.T) { balance, err = dymension.GetBalance(ctx, marketMakerAddr, dymension.Config().Denom) require.NoError(t, err) fmt.Println("Balance of marketMakerAddr after fulfilling the order:", balance) - expBalanceMarketMaker := walletAmount.Add((globalEIbcFee.Mul(math.NewInt(2)))) + expBalanceMarketMaker := walletAmount.Add(globalEIbcFee.Mul(math.NewInt(2))).Sub(transferAmount) require.True(t, balance.Equal(expBalanceMarketMaker), fmt.Sprintf("Value mismatch. Expected %s, actual %s", expBalanceMarketMaker, balance)) t.Cleanup( @@ -1660,7 +1660,7 @@ func TestEIBCUpdateOnAckErrAndTimeout_Wasm(t *testing.T) { require.NoError(t, err) // get eibc event - eibcEvents, err := getEIbcEventsWithinBlockRange(ctx, dymension, 30, false) + eibcEvents, err := getEIbcEventsWithinBlockRange(ctx, dymension, 20, false) require.NoError(t, err) fmt.Println("Event:", eibcEvents) require.Equal(t, eibcEvents[0].Price, fmt.Sprintf("%s%s", transferAmountWithoutFee, dymension.Config().Denom)) @@ -1926,7 +1926,7 @@ func TestEIBCUpdateOnTimeout_Unallowed_EVM(t *testing.T) { require.NoError(t, err) // get eibc event - eibcEvents, err := getEIbcEventsWithinBlockRange(ctx, dymension, 30, false) + eibcEvents, err := getEIbcEventsWithinBlockRange(ctx, dymension, 20, false) require.NoError(t, err) fmt.Println("Event:", eibcEvents) require.Equal(t, eibcEvents[0].Price, fmt.Sprintf("%s%s", transferAmountWithoutFee, dymension.Config().Denom)) @@ -2157,7 +2157,7 @@ func TestEIBCUpdateOnTimeout_Unallowed_Wasm(t *testing.T) { require.NoError(t, err) // get eibc event - eibcEvents, err := getEIbcEventsWithinBlockRange(ctx, dymension, 50, false) + eibcEvents, err := getEIbcEventsWithinBlockRange(ctx, dymension, 20, false) require.NoError(t, err) fmt.Println("Event:", eibcEvents) require.Equal(t, eibcEvents[0].Price, fmt.Sprintf("%s%s", transferAmountWithoutFee, dymension.Config().Denom)) diff --git a/tests/ibc_timeout_test.go b/tests/ibc_timeout_test.go index b84a4929..6afd20d6 100644 --- a/tests/ibc_timeout_test.go +++ b/tests/ibc_timeout_test.go @@ -205,9 +205,6 @@ func TestIBCTransferTimeout_EVM(t *testing.T) { rollappTokenDenom := transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, rollapp1.Config().Denom) rollappIBCDenom := transfertypes.ParseDenomTrace(rollappTokenDenom).IBCDenom() - err = testutil.WaitForBlocks(ctx, 150, dymension, rollapp1) - require.NoError(t, err) - // Assert funds were returned to the sender after the timeout has occured testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferData.Amount)) testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, rollappIBCDenom, transferAmount.Sub(bridgingFee)) @@ -244,9 +241,6 @@ func TestIBCTransferTimeout_EVM(t *testing.T) { require.NoError(t, err) require.True(t, isFinalized) - err = testutil.WaitForBlocks(ctx, 150, dymension, rollapp1) - require.NoError(t, err) - // Assert funds were returned to the sender after the timeout has occured testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, dymensionIBCDenom, zeroBal) testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, walletAmount) @@ -445,9 +439,6 @@ func TestIBCTransferTimeout_Wasm(t *testing.T) { rollappTokenDenom := transfertypes.GetPrefixedDenom(channel.Counterparty.PortID, channel.Counterparty.ChannelID, rollapp1.Config().Denom) rollappIBCDenom := transfertypes.ParseDenomTrace(rollappTokenDenom).IBCDenom() - err = testutil.WaitForBlocks(ctx, 150, dymension, rollapp1) - require.NoError(t, err) - // Assert funds were returned to the sender after the timeout has occured testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, rollapp1.Config().Denom, walletAmount.Sub(transferData.Amount)) testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, rollappIBCDenom, transferAmount.Sub(bridgingFee)) @@ -484,9 +475,6 @@ func TestIBCTransferTimeout_Wasm(t *testing.T) { require.NoError(t, err) require.True(t, isFinalized) - err = testutil.WaitForBlocks(ctx, 150, dymension, rollapp1) - require.NoError(t, err) - // Assert funds were returned to the sender after the timeout has occured testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, dymensionIBCDenom, zeroBal) testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, walletAmount)