You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! Recent changes in ibc-go 7.1.0 (see apps/transfer in release notes and specifically ADR-011 for the background) are breaking unit tests for ibc-hooks package. While it can still work fine with ibc-go 7.2.0, this mock of escrow in the test is not sufficient anymore:
This is because escrow amounts now tracked in TransferKeeper as well, not only as balances in the bank module.
To properly simulate escrowing tokens without actually sending them, the caller must also set the total escrow amount in the TransferKeeper directly:
// SetTotalEscrowForDenom stores the total amount of source chain tokens that are in escrow.// Amount is stored in state if and only if it is not equal to zero. The function will panic// if the amount is negative.func (kKeeper) SetTotalEscrowForDenom(ctx sdk.Context, coin sdk.Coin)
I have made necessary changes in PR #56 please note that it supports versions prior to 7.1.0 as well, that don't have SetTotalEscrowForDenom available in TransferKeeper.
The content you are editing has changed. Please copy your edits and refresh the page.
xlab
changed the title
ibc-hooks: failing unit tests when using with ibc-go >= 0.7.1
ibc-hooks: failing unit tests when using with ibc-go >= 7.1.0
Jul 12, 2023
Hello! Recent changes in ibc-go 7.1.0 (see apps/transfer in release notes and specifically ADR-011 for the background) are breaking unit tests for
ibc-hooks
package. While it can still work fine withibc-go 7.2.0
, this mock of escrow in the test is not sufficient anymore:ibc-apps/modules/ibc-hooks/tests/unit/module_test.go
Lines 103 to 105 in a1e4804
Will result in a panic like this:
This is because escrow amounts now tracked in TransferKeeper as well, not only as balances in the bank module.
To properly simulate escrowing tokens without actually sending them, the caller must also set the total escrow amount in the TransferKeeper directly:
I have made necessary changes in PR #56 please note that it supports versions prior to
7.1.0
as well, that don't haveSetTotalEscrowForDenom
available in TransferKeeper.Tasks
The text was updated successfully, but these errors were encountered: