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

Voting's helper update_status() should save changed status #62

Closed
ueco-jb opened this issue Feb 2, 2022 · 1 comment
Closed

Voting's helper update_status() should save changed status #62

ueco-jb opened this issue Feb 2, 2022 · 1 comment

Comments

@ueco-jb
Copy link

ueco-jb commented Feb 2, 2022

Originally posted by @ueco-jb in #60 (comment)

Currently that helper might change status, for example from Open to Rejected, if contract expires.
https://github.com/confio/poe-contracts/blob/main/packages/voting-contract/src/state.rs#L206-L208
We are using that to see most recent status when someone tries to vote.
Problem is, if status is Rejected and we return an Error... Then proposal's status will be back Open, because changes were not saved on returned error.

This will be confusing and we should mitigate that.

@ueco-jb
Copy link
Author

ueco-jb commented Feb 2, 2022

Actually I just realized, that this is currently mitigated... because queries uses same update_status() helper as well.
So despite status not being correct in memory, it's correct for end user who does the query.

@ueco-jb ueco-jb closed this as completed Feb 2, 2022
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

No branches or pull requests

1 participant