feat: check for custom min voting power when voting #614
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Closes: #597
This PR add support for custom minimum required voting power for offchain voting.
Until now, we allowed anyone with voting power > 0 to cast the vote, and it'll just fail on the backend with an error.
With this PR, we will validate the voting power before allowing user to cast the vote, preventing user frustration and unnecessary actions.
How to test
Go to snapshot.org, and create some proposals with the following conditions (need to edit space settings before creating each proposals):
A. A regular proposal, with basic voting validation (anyone with non-null vp can vote)
B. A proposal with custom minimum voting power (need at least X vp to vote)
Now, try to vote on each of these proposals, by opening the vote modal.
In case of A:
In case of B: