From 4d66f524c35267d75f442430c729dc840b2875e5 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) # Conflicts: # x/gov/types/events.go --- x/gov/keeper/vote.go | 1 + x/gov/types/events.go | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/x/gov/keeper/vote.go b/x/gov/keeper/vote.go index 7f43bec1266..2f24c37d2e9 100644 --- a/x/gov/keeper/vote.go +++ b/x/gov/keeper/vote.go @@ -37,6 +37,7 @@ func (keeper Keeper) AddVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.A ctx.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 76927591af8..7758abc8b59 100644 --- a/x/gov/types/events.go +++ b/x/gov/types/events.go @@ -9,6 +9,7 @@ const ( EventTypeActiveProposal = "active_proposal" EventTypeSignalProposal = "signal_proposal" +<<<<<<< HEAD AttributeKeyProposalResult = "proposal_result" AttributeKeyOption = "option" AttributeKeyProposalID = "proposal_id" @@ -21,4 +22,23 @@ const ( AttributeKeyProposalType = "proposal_type" AttributeSignalTitle = "signal_title" AttributeSignalDescription = "signal_description" +======= + AttributeKeyProposalResult = "proposal_result" + AttributeKeyVoter = "voter" + AttributeKeyOption = "option" + AttributeKeyProposalID = "proposal_id" + AttributeKeyProposalMessages = "proposal_messages" // Msg type_urls in the proposal + AttributeKeyVotingPeriodStart = "voting_period_start" + AttributeKeyProposalLog = "proposal_log" // log of proposal execution + AttributeValueProposalDropped = "proposal_dropped" // didn't meet min deposit + AttributeValueProposalPassed = "proposal_passed" // met vote quorum + AttributeValueProposalRejected = "proposal_rejected" // didn't meet vote quorum + AttributeValueExpeditedProposalRejected = "expedited_proposal_rejected" // didn't meet expedited vote quorum + AttributeValueProposalFailed = "proposal_failed" // error on proposal handler + AttributeValueProposalCanceled = "proposal_canceled" // error on proposal handler + + AttributeKeyProposalType = "proposal_type" + AttributeSignalTitle = "signal_title" + AttributeSignalDescription = "signal_description" +>>>>>>> 85d9791ed (feat(x/gov): Emit VoterAddr (#17354)) )