From 47ff28bcc1c4ee3828cf75af9bce20ba0085a7b3 Mon Sep 17 00:00:00 2001 From: Devon Bear Date: Fri, 11 Aug 2023 03:51:17 -0400 Subject: [PATCH 1/2] 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 4e2436ff84b5..8fa690eeca87 100644 --- a/x/gov/keeper/vote.go +++ b/x/gov/keeper/vote.go @@ -38,6 +38,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 7217e7e38793..d6b2b30c1c01 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" @@ -22,4 +23,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)) ) From 91950267ac3699a6093a83dea26c747028d2252e Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 11 Aug 2023 10:00:29 +0200 Subject: [PATCH 2/2] fix conflict + changelog --- CHANGELOG.md | 1 + x/gov/types/events.go | 21 +-------------------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bd17d1a2cf4..9d0448dcdbac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +* (x/gov) [#17354](https://github.com/cosmos/cosmos-sdk/issues/17354) Emit `VoterAddr` in `proposal_vote` event. * (x/genutil) [#17296](https://github.com/cosmos/cosmos-sdk/pull/17296) Add `MigrateHandler` to allow reuse migrate genesis related function. * In v0.46, v0.47 this function is additive to the `genesis migrate` command. However in v0.50+, adding custom migrations to the `genesis migrate` command is directly possible. diff --git a/x/gov/types/events.go b/x/gov/types/events.go index d6b2b30c1c01..9468c0fc9862 100644 --- a/x/gov/types/events.go +++ b/x/gov/types/events.go @@ -9,8 +9,8 @@ const ( EventTypeActiveProposal = "active_proposal" EventTypeSignalProposal = "signal_proposal" -<<<<<<< HEAD AttributeKeyProposalResult = "proposal_result" + AttributeKeyVoter = "voter" AttributeKeyOption = "option" AttributeKeyProposalID = "proposal_id" AttributeKeyProposalMessages = "proposal_messages" // Msg type_urls in the proposal @@ -23,23 +23,4 @@ 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)) )