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)
  • Loading branch information
itsdevbear authored and mergify[bot] committed Aug 11, 2023
1 parent 4e55f96 commit 9601dd7
Show file tree
Hide file tree
Showing 2 changed files with 2 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 @@ -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)),
),
Expand Down
1 change: 1 addition & 0 deletions x/gov/types/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9601dd7

Please sign in to comment.