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: check ack success if only ack is not async #2662

Merged
merged 3 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions tests/e2e/e2e_ibc_memo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,11 @@ func (s *E2ETest) testIBCTokenTransferWithMemo(umeeAPIEndpoint string, atomQuota
updatedIBCAtomBalance = updatedIBCAtomBalance.Add(atomFromGaia.Amount)
s.checkSupply(umeeAPIEndpoint, uatomIBCHash, updatedIBCAtomBalance)
s.checkLeverageAccountBalance(umeeAPIEndpoint, accs.Alice.String(), uatomIBCHash, atomFromGaia.Amount)

// ignore ibc forward memo msgs
invalidM := "{\"forward\":{\"channel\":\"channel-123\",\"port\":\"transfer\",\"receiver\":\"secret1xs0xv4h9d2y2fpagyt99vpm3d3f8jxh9kywh6x\",\"retries\":2,\"timeout\":1733978966221063114}}"
s.SendIBC(setup.GaiaChainID, s.Chain.ID, accs.Alice.String(), atomFromGaia, "", invalidM, "")
updatedIBCAtomBalance = updatedIBCAtomBalance.Add(atomFromGaia.Amount)
s.checkSupply(umeeAPIEndpoint, uatomIBCHash, updatedIBCAtomBalance)
s.checkLeverageAccountBalance(umeeAPIEndpoint, accs.Alice.String(), uatomIBCHash, atomFromGaia.Amount)
}
3 changes: 2 additions & 1 deletion x/uibc/uics20/ibc_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ func (im ICS20Module) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet,
execCtx, execCtxFlush := transferCtx.CacheContext()

// call transfer module app
// ack is nil if acknowledgement is asynchronous
ack := im.IBCModule.OnRecvPacket(transferCtx, packet, relayer)
if !ack.Success() {
if ack != nil && !ack.Success() {
goto end
}

Expand Down
4 changes: 4 additions & 0 deletions x/uibc/uics20/memo_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ func TestMsgMarshalling(t *testing.T) {
bz = []byte(`{"messages": ["any message"]}`)
memo2, err = deserializeMemo(cdc, bz)
assert.Error(err)

bz = []byte(`"{\"forward\":{\"channel\":\"channel-123\",\"port\":\"transfer\",\"receiver\":\"secret1xs0xv4h9d2y2fpagyt99vpm3d3f8jxh9kywh6x\",\"retries\":2,\"timeout\":1733978966221063114}}"`)
memo2, err = deserializeMemo(cdc, bz)
assert.Error(err)
}

func TestAdjustOperatedCoin(t *testing.T) {
Expand Down
Loading