From 892b8565886aa3778b2fa71aa3fe023be60aca14 Mon Sep 17 00:00:00 2001 From: Marri Harish Date: Thu, 4 Jan 2024 22:24:07 +0530 Subject: [PATCH] fix fee deduction on stream send (#26) --- x/streampay/keeper/msg_server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/streampay/keeper/msg_server.go b/x/streampay/keeper/msg_server.go index 04853a1..60ee3df 100644 --- a/x/streampay/keeper/msg_server.go +++ b/x/streampay/keeper/msg_server.go @@ -47,7 +47,7 @@ func (m msgServer) StreamSend(goCtx context.Context, msg *types.MsgStreamSend) ( return nil, err } feePercentage := m.Keeper.GetStreamPaymentFeePercentage(ctx) - feeAmount := sdk.NewCoin(msg.Amount.Denom, msg.Amount.Amount.ToLegacyDec().Mul(feePercentage).TruncateInt()) + feeAmount := sdk.NewCoin(msg.Amount.Denom, sdk.NewDecFromInt(msg.Amount.Amount).Mul(feePercentage).TruncateInt()) amountToSend := msg.Amount.SubAmount(feeAmount.Amount) if err := m.distributionKeeper.FundCommunityPool(ctx, sdk.NewCoins(feeAmount), sender); err != nil {