feat(x/gov): Emit VoterAddr (backport #17354) (#17355)

Co-authored-by: Devon Bear <itsdevbear@berachain.com>
This commit is contained in:
mergify[bot] 2023-08-11 08:06:59 +00:00 committed by GitHub
parent 4e55f96a6d
commit 5b0c08130c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -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)),
),

View File

@ -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