From 47c2ed65e657e46e2b005de22846f766262484de Mon Sep 17 00:00:00 2001 From: rustdev Date: Thu, 23 May 2024 20:15:30 +0100 Subject: [PATCH] rename fn and remove commented code. --- custom/custompfm/keeper/keeper.go | 4 +--- x/ibctransfermiddleware/keeper/keeper.go | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/custom/custompfm/keeper/keeper.go b/custom/custompfm/keeper/keeper.go index 9496a035..bbe234d2 100644 --- a/custom/custompfm/keeper/keeper.go +++ b/custom/custompfm/keeper/keeper.go @@ -162,8 +162,6 @@ func (im IBCMiddleware) OnRecvPacket( retries = im.retriesOnTimeout1 } - // im.ibcfeekeeper.Transfer() - feeAmount := sdk.NewDecFromInt(token.Amount).Mul(im.keeper1.GetFeePercentage(ctx)).RoundInt() packetAmount := token.Amount.Sub(feeAmount) packetCoin := sdk.NewCoin(token.Denom, packetAmount) @@ -196,7 +194,7 @@ func (im IBCMiddleware) OnRecvPacket( memo, ) - result, err := im.ibcfeekeeper.ChargeFee(ctx, tr) + result, err := im.ibcfeekeeper.GetBridgeFeeBasedOnConfigForChannelAndDenom(ctx, tr) if err != nil { logger.Error("packetForwardMiddleware OnRecvPacket error charging fee", "error", err) return newErrorAcknowledgement(fmt.Errorf("error charging fee: %w", err)) diff --git a/x/ibctransfermiddleware/keeper/keeper.go b/x/ibctransfermiddleware/keeper/keeper.go index d43741d6..f0c0b5cd 100644 --- a/x/ibctransfermiddleware/keeper/keeper.go +++ b/x/ibctransfermiddleware/keeper/keeper.go @@ -116,7 +116,7 @@ type BridgeFee struct { Receiver sdk.AccAddress } -func (k Keeper) ChargeFee(ctx sdk.Context, msg *ibctypes.MsgTransfer) (*BridgeFee, error) { +func (k Keeper) GetBridgeFeeBasedOnConfigForChannelAndDenom(ctx sdk.Context, msg *ibctypes.MsgTransfer) (*BridgeFee, error) { params := k.GetParams(ctx) // charge_coin := sdk.NewCoin(msg.Token.Denom, sdk.ZeroInt()) if params.ChannelFees != nil && len(params.ChannelFees) > 0 {