-
Notifications
You must be signed in to change notification settings - Fork 0
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
Adjust tribute refunding condition #146
Conversation
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 still think we should extract a method from refund_tribute and claim_tribute.
These two going out of sync is the kind of thing that will cause bugs in the future.
How about making it a function "TributeIsRefundable() -> (bool, str)", where the string is a message that explains the "why" and that can be used in error returns.
For example, if the proposal is in the top N and has the percentage, the return is:
false, "proposal is in the top N and has at least x% of the votes".
if its not in the top N:
true, "proposal is not in the top N"
if it does not have the percentage threshold:
true, "proposal does not have at least x% of the votes"
Then the message can be used to inform the error return. so for claiming, if "IsRefundable" returns true, it would go:
"Cannot claim tribute:" + message, so e.g. it would look like
"Cannot claim tribute: proposal is not in the top N"
Closes #140
This PR does the following: