-
Notifications
You must be signed in to change notification settings - Fork 355
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 threshold to cw3 flex #180
Conversation
8ccb6c9
to
f356728
Compare
This should be ready to review. Covered with lots of unit tests. I will provide a few high-level scenario tests for the more dynamic variants, but the logic should all be covered with tests now. |
Finished added all tests |
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.
Incomplete review. Posting anyway for your consideration.
I propose we have a chat tomorrow to discuss some details I'm certainly missing.
Please review #188 and give feedback there, then we can see what discussion points are still open. |
Also I addressed the edge case on hitting absolute threshold, but not quorum that you pointed out. Good catch there. |
83406ad
to
3f3b379
Compare
863f23c
to
382cbf1
Compare
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.
Looks good.
Only remaining (minor) concern I have is about Abstain
subtraction when compute passing weight in AbsoluteThreshold
.
Co-authored-by: Mauro Lacy <maurolacy@users.noreply.github.com>
ed1f102
to
0fd5a88
Compare
I just added a few smaller commits for some of the last outstanding points. If you can unify the docs a bit more, that would be great. Then feel free to merge when done with docs update. |
This is looking great.
OK. One more thing: Or is it called |
Add reference to cw3 spec docs Update schema
85edc38
to
f33e3aa
Compare
I'll add an issue to consider implementing Merging now. |
Your idea of Anyway, feel free to add an issue for |
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'd love hyperlinks or other way to connect these two descriptions better
/// A proposal of this type can pass early as soon as the needed weight of yes votes has been cast. | ||
/// Declares a percentage of the total weight that must cast Yes votes in order for | ||
/// a proposal to pass. | ||
/// See `ThresholdResponse.AbsolutePercentage` in the cw3 spec for details. |
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.
It would be cool to see these as hyperlinks.
These seem to be possible in RustDoc, and even better supported since 1.48
Also see the RFC for more details
(Side-note, we really need to review the RustDoc output once we push 0.4.0)
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.
Yes, they are possible, and are used extensively in the crates documentation. Here in particular, I first added and afterwards then removed the hyperlink formatting, because these comments go to the json files.
We definitely should start using these links, and confirm that they are working correctly in the crates docs.
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.
(Side-note, we really need to review the RustDoc output once we push 0.4.0)
I propose we create an issue in cosmwasm for that, and consider / mention all the projects.
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.
Oh, there are issues... for quite some time:
Just seems that all of us prefer to code than tidy up RustDoc
Closes #139
This allows us to set any of the 3 defined threshold types for passing proposals.
Handler code is working and tested for the original case (
AbsoluteCount
).Low level code (calculate passing, etc) is tested for all cases I could think of.
TODO: