Skip to content

Commit

Permalink
feat(x/gov): Emit VoterAddr (backport #17354) (#17356)
Browse files Browse the repository at this point in the history
Co-authored-by: Devon Bear <[email protected]>
Co-authored-by: Julien Robert <[email protected]>
  • Loading branch information
3 people authored Aug 11, 2023
1 parent 0f3a2ec commit a7dffbf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/group, x/gov) [#17220](https://github.com/cosmos/cosmos-sdk/pull/17220) Add `--skip-metadata` flag in `draft-proposal` to skip metadata prompt.
* (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.
Expand Down
1 change: 1 addition & 0 deletions x/gov/keeper/vote.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
),
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 @@ -9,6 +9,7 @@ const (
EventTypeActiveProposal = "active_proposal"
EventTypeSignalProposal = "signal_proposal"

AttributeKeyVoter = "voter"
AttributeKeyProposalResult = "proposal_result"
AttributeKeyOption = "option"
AttributeKeyProposalID = "proposal_id"
Expand Down

0 comments on commit a7dffbf

Please sign in to comment.