Skip to content

Commit

Permalink
feat(x/gov): Emit VoterAddr (#17354)
Browse files Browse the repository at this point in the history
(cherry picked from commit 85d9791)

# Conflicts:
#	x/gov/types/events.go
  • Loading branch information
Devon Bear authored and mergify[bot] committed Aug 11, 2023
1 parent 5372570 commit 47ff28b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions x/gov/keeper/vote.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
),
Expand Down
20 changes: 20 additions & 0 deletions x/gov/types/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const (
EventTypeActiveProposal = "active_proposal"
EventTypeSignalProposal = "signal_proposal"

<<<<<<< HEAD
AttributeKeyProposalResult = "proposal_result"
AttributeKeyOption = "option"
AttributeKeyProposalID = "proposal_id"
Expand All @@ -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))
)

0 comments on commit 47ff28b

Please sign in to comment.