Skip to content

Commit

Permalink
chore: change denom
Browse files Browse the repository at this point in the history
  • Loading branch information
ellie4x committed May 27, 2022
1 parent d5d73fe commit 4511653
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions modules/apps/transfer/keeper/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
5 changes: 4 additions & 1 deletion modules/apps/transfer/keeper/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
6 changes: 3 additions & 3 deletions modules/apps/transfer/types/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand All @@ -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)
}
}

0 comments on commit 4511653

Please sign in to comment.