From 15ea7a5bf8fdd5c343455f6b3d9e1f77da534423 Mon Sep 17 00:00:00 2001 From: scorpioborn <97235353+scorpioborn@users.noreply.github.com> Date: Fri, 17 Nov 2023 11:24:19 +0300 Subject: [PATCH] feat: dposit fee amount message in the subaccount transaction --- x/subaccount/types/events.go | 1 + x/subaccount/types/messages_house.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/x/subaccount/types/events.go b/x/subaccount/types/events.go index 3c424452d..cab96e471 100644 --- a/x/subaccount/types/events.go +++ b/x/subaccount/types/events.go @@ -13,6 +13,7 @@ const ( const ( attributeKeyDepositCreator = "creator" attributeKeySubAccDepositor = "subacc_depositor" + attributeKeySubAccDepositFee = "subacc_deposit_fee" attributeKeyWithdrawalID = "withdrawal_id" attributeKeyDepositMarketUIDParticipantIndex = "deposit_market_index" attributeKeyWithdrawMarketUIDParticipantIndex = "withdraw_market_index" diff --git a/x/subaccount/types/messages_house.go b/x/subaccount/types/messages_house.go index 1924b808f..42a6a8b29 100644 --- a/x/subaccount/types/messages_house.go +++ b/x/subaccount/types/messages_house.go @@ -3,6 +3,7 @@ package types import ( "strings" + sdkmath "cosmossdk.io/math" "github.com/spf13/cast" sdk "github.com/cosmos/cosmos-sdk/types" @@ -47,11 +48,12 @@ func (msg *MsgHouseDeposit) ValidateBasic() error { } // EmitEvent emits the event for the message success. -func (msg *MsgHouseDeposit) EmitEvent(ctx *sdk.Context, subAccAddr string, participationIndex uint64) { +func (msg *MsgHouseDeposit) EmitEvent(ctx *sdk.Context, subAccAddr string, participationIndex uint64, feeAmount sdkmath.Int) { emitter := utils.NewEventEmitter(ctx, attributeValueCategory) emitter.AddMsg(typeMsgHouseDeposit, msg.Msg.Creator, sdk.NewAttribute(attributeKeyDepositCreator, msg.Msg.Creator), sdk.NewAttribute(attributeKeySubAccDepositor, subAccAddr), + sdk.NewAttribute(attributeKeySubAccDepositFee, feeAmount.String()), sdk.NewAttribute(attributeKeyDepositMarketUIDParticipantIndex, strings.Join([]string{msg.Msg.MarketUID, cast.ToString(participationIndex)}, "#"), ),