Skip to content

Commit

Permalink
feat: dposit fee amount message in the subaccount transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
scorpioborn committed Nov 17, 2023
1 parent 1376e82 commit 15ea7a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions x/subaccount/types/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion x/subaccount/types/messages_house.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package types
import (
"strings"

sdkmath "cosmossdk.io/math"
"github.com/spf13/cast"

sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -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)}, "#"),
),
Expand Down

0 comments on commit 15ea7a5

Please sign in to comment.