-
Notifications
You must be signed in to change notification settings - Fork 48
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
fix: do not allow to answer a poll after voting period ends #964
Conversation
Signed-off-by: Riccardo Montagnin <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #964 +/- ##
==========================================
- Coverage 82.46% 82.43% -0.03%
==========================================
Files 167 168 +1
Lines 14244 14289 +45
==========================================
+ Hits 11746 11779 +33
- Misses 2014 2023 +9
- Partials 484 487 +3
Continue to review full report at Codecov.
|
Signed-off-by: Riccardo Montagnin <[email protected]>
Signed-off-by: Riccardo Montagnin <[email protected]>
…/improve-polls-answers
Signed-off-by: Riccardo Montagnin <[email protected]>
Signed-off-by: Riccardo Montagnin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
x/posts/legacy/v4/store.go
Outdated
|
||
// removeUserAnswers iterates over all the polls and deletes the user answers for all the polls which | ||
// final results already been tallied. This is to delete all the answers that have been added after that. | ||
func removeUserAnswers(store sdk.KVStore, cdc codec.BinaryCodec) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would name it removeInvalidAnswers
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
Signed-off-by: Riccardo Montagnin <[email protected]>
Co-authored-by: Paul <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to me
Description
This PR fixes a bug within the
x/posts
module that currently allows users to answer a poll even when it's already ended.Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change