From 6bcc310c394f6bb760f63f880fea841997fcd5b2 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Thu, 14 Dec 2023 15:17:45 +0100 Subject: [PATCH] adding dispatcher test --- x/uibc/uics20/ibc_module.go | 8 ++++++-- x/uibc/uics20/ics4_module_int_test.go | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 x/uibc/uics20/ics4_module_int_test.go diff --git a/x/uibc/uics20/ibc_module.go b/x/uibc/uics20/ibc_module.go index c4828d880b..6063de3ba1 100644 --- a/x/uibc/uics20/ibc_module.go +++ b/x/uibc/uics20/ibc_module.go @@ -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) } } @@ -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, diff --git a/x/uibc/uics20/ics4_module_int_test.go b/x/uibc/uics20/ics4_module_int_test.go new file mode 100644 index 0000000000..33559f4169 --- /dev/null +++ b/x/uibc/uics20/ics4_module_int_test.go @@ -0,0 +1,5 @@ +package main + +import ( + "fmt" +)