From 9601dd795f4b553ef66182703f5ba3101f5cd68a Mon Sep 17 00:00:00 2001 From: Devon Bear Date: Fri, 11 Aug 2023 03:51:17 -0400 Subject: [PATCH] feat(x/gov): Emit VoterAddr (#17354) (cherry picked from commit 85d9791edf6a5008bbf2f6e036629398aa986f99) --- x/gov/keeper/vote.go | 1 + x/gov/types/events.go | 1 + 2 files changed, 2 insertions(+) diff --git a/x/gov/keeper/vote.go b/x/gov/keeper/vote.go index 6f19007c043d..0bc99653d509 100644 --- a/x/gov/keeper/vote.go +++ b/x/gov/keeper/vote.go @@ -48,6 +48,7 @@ func (keeper Keeper) AddVote(ctx context.Context, proposalID uint64, voterAddr s sdkCtx.EventManager().EmitEvent( sdk.NewEvent( types.EventTypeProposalVote, + sdk.NewAttribute(types.AttributeKeyVoter, voterAddr.String()), sdk.NewAttribute(types.AttributeKeyOption, options.String()), sdk.NewAttribute(types.AttributeKeyProposalID, fmt.Sprintf("%d", proposalID)), ), diff --git a/x/gov/types/events.go b/x/gov/types/events.go index c7f895234f0b..96ccc5577e33 100644 --- a/x/gov/types/events.go +++ b/x/gov/types/events.go @@ -10,6 +10,7 @@ const ( EventTypeCancelProposal = "cancel_proposal" AttributeKeyProposalResult = "proposal_result" + AttributeKeyVoter = "voter" AttributeKeyOption = "option" AttributeKeyProposalID = "proposal_id" AttributeKeyProposalMessages = "proposal_messages" // Msg type_urls in the proposal