Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hooks to x/gov OnVote #9105

Closed
4 tasks
ValarDragon opened this issue Apr 13, 2021 · 2 comments · Fixed by #9133
Closed
4 tasks

Add hooks to x/gov OnVote #9105

ValarDragon opened this issue Apr 13, 2021 · 2 comments · Fixed by #9133

Comments

@ValarDragon
Copy link
Contributor

Summary

Currently there are no hooks on x/gov. However, it would be useful to have hooks for when a user votes on a proposal, as an application may want to provide additional incentivizes for voting users on certain proposals.

(I think we should separately add more hooks for once a proposal has finished deposit period, and a tally event occurs)

Proposal

Add the following hook that executes after a user has voted.

AfterUserVoted(Context, AccAddress, VoteType)

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@fedekunze
Copy link
Collaborator

fedekunze commented Apr 19, 2021

proposal ACK. Can you name some use cases for this improvement? How would you imagine this being used by different chains? @sunnya97

@sunnya97
Copy link
Member

Osmosis is using this specific hook in order to reward users for casting a vote, and so our module giving this reward needs to receive a hook whenever a vote is cast

I can imagine other use cases as well, such as one that keeps track of how many votes have been cast so far, and to perhaps end a voting period early if certain conditions are met.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants