From 5b0c08130c524c8eadd27f34840bef57280a946c Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 11 Aug 2023 08:06:59 +0000 Subject: [PATCH] feat(x/gov): Emit VoterAddr (backport #17354) (#17355) Co-authored-by: Devon Bear --- 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