Skip to content

Commit

Permalink
rename fn and remove commented code.
Browse files Browse the repository at this point in the history
  • Loading branch information
RustNinja committed May 23, 2024
1 parent b650645 commit 47c2ed6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions custom/custompfm/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion x/ibctransfermiddleware/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 47c2ed6

Please sign in to comment.