From 5dabfe56159bd23b6f3c70cbabc2e05ae8544320 Mon Sep 17 00:00:00 2001 From: Thomas Nguy Date: Fri, 27 Aug 2021 11:40:33 +0900 Subject: [PATCH] add callback --- modules/apps/transfer/keeper/callbacks.go | 19 +++++++++++++++++++ modules/apps/transfer/module.go | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 modules/apps/transfer/keeper/callbacks.go diff --git a/modules/apps/transfer/keeper/callbacks.go b/modules/apps/transfer/keeper/callbacks.go new file mode 100644 index 00000000000..ee5a078f72a --- /dev/null +++ b/modules/apps/transfer/keeper/callbacks.go @@ -0,0 +1,19 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + "github.com/cosmos/ibc-go/modules/core/exported" +) + +// SendPacket is called by a module in order to send an IBC packet on a channel +// end owned by the calling module to the corresponding module on the counterparty +// chain. +func (k Keeper) SendPacket( + ctx sdk.Context, + channelCap *capabilitytypes.Capability, + packet exported.PacketI, +) error { + //todo + return k.channelKeeper.SendPacket(ctx, channelCap, packet) +} diff --git a/modules/apps/transfer/module.go b/modules/apps/transfer/module.go index bae622f2fde..7e51a627b3e 100644 --- a/modules/apps/transfer/module.go +++ b/modules/apps/transfer/module.go @@ -246,7 +246,7 @@ func (am AppModule) OnChanOpenInit( transferVersion = appVersion } - if err := ValidateTransferChannelParams(ctx, am.keeper, order, portID, channelID, appVersion); err != nil { + if err := ValidateTransferChannelParams(ctx, am.keeper, order, portID, channelID, transferVersion); err != nil { return err }