From 45116537521747ffc16e26977ebe15dc313c61bf Mon Sep 17 00:00:00 2001 From: ellie Date: Fri, 27 May 2022 22:03:42 +0900 Subject: [PATCH] chore: change denom --- modules/apps/transfer/keeper/hooks.go | 4 ++-- modules/apps/transfer/keeper/relay.go | 5 ++++- modules/apps/transfer/types/hooks.go | 6 +++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/apps/transfer/keeper/hooks.go b/modules/apps/transfer/keeper/hooks.go index c01e3be43b2..50f1877638b 100644 --- a/modules/apps/transfer/keeper/hooks.go +++ b/modules/apps/transfer/keeper/hooks.go @@ -6,6 +6,6 @@ import ( ) // AfterEpochEnd executes the indicated hook after epochs ends -func (k Keeper) AfterTransferEnd(ctx sdk.Context, packet types.FungibleTokenPacketData) { - k.hooks.AfterTransferEnd(ctx, packet) +func (k Keeper) AfterTransferEnd(ctx sdk.Context, packet types.FungibleTokenPacketData, base_denom string) { + k.hooks.AfterTransferEnd(ctx, packet, base_denom) } diff --git a/modules/apps/transfer/keeper/relay.go b/modules/apps/transfer/keeper/relay.go index 970a7c42058..a12d1e79207 100644 --- a/modules/apps/transfer/keeper/relay.go +++ b/modules/apps/transfer/keeper/relay.go @@ -345,7 +345,10 @@ func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Pac default: // the acknowledgement succeeded on the receiving chain so nothing // needs to be executed and no error needs to be returned - k.AfterTransferEnd(ctx, data) + + //TODO : add filter + denom := types.ParseDenomTrace(data.Denom) + k.AfterTransferEnd(ctx, data, denom.BaseDenom) return nil } } diff --git a/modules/apps/transfer/types/hooks.go b/modules/apps/transfer/types/hooks.go index 313e1e8c442..f1dc32b955f 100644 --- a/modules/apps/transfer/types/hooks.go +++ b/modules/apps/transfer/types/hooks.go @@ -5,7 +5,7 @@ import ( ) type TransferHooks interface { - AfterTransferEnd(ctx sdk.Context, data FungibleTokenPacketData) + AfterTransferEnd(ctx sdk.Context, data FungibleTokenPacketData, base_denom string) } var _ TransferHooks = MultiTransferHooks{} @@ -16,8 +16,8 @@ func NewMultiTransferHooks(hooks ...TransferHooks) MultiTransferHooks { return hooks } -func (h MultiTransferHooks) AfterTransferEnd(ctx sdk.Context, data FungibleTokenPacketData) { +func (h MultiTransferHooks) AfterTransferEnd(ctx sdk.Context, data FungibleTokenPacketData, base_denom string) { for i := range h { - h[i].AfterTransferEnd(ctx, data) + h[i].AfterTransferEnd(ctx, data, base_denom) } }