Skip to content

Commit

Permalink
adding dispatcher test
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-zaremba committed Dec 14, 2023
1 parent 132e234 commit 6bcc310
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 6 additions & 2 deletions x/uibc/uics20/ibc_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (im ICS20Module) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet,
ctx.Logger().Error("can't JSON deserialize ftData Memo, expecting list of Msg", "err", err)
} else {
// TODO: need to handle fees!
im.dispatchMemoMsgs(msgs)
im.dispatchMemoMsgs(ctx, msgs)
}
}

Expand Down Expand Up @@ -101,9 +101,13 @@ func (im ICS20Module) onAckErr(ctx *sdk.Context, packet channeltypes.Packet) {
// messages are supported. Otherwise the fork storage is discarded.
func (im ICS20Module) dispatchMemoMsgs(ctx sdk.Context, msgs []sdk.Msg) {
// Caching context so that we don't update the store in case of failure.
cacheCtx, flush := ctx.CacheContext()
///cacheCtx, flush := ctx.CacheContext()
// TODO: call flush on success

for _, m := range msgs {
ctx.Logger().Info("dispatching", "msg", m)
}

}

func deserializeFTData(cdc codec.JSONCodec, packet channeltypes.Packet,
Expand Down
5 changes: 5 additions & 0 deletions x/uibc/uics20/ics4_module_int_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package main

import (
"fmt"
)

0 comments on commit 6bcc310

Please sign in to comment.