-
Notifications
You must be signed in to change notification settings - Fork 609
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/test/docs: negative interval accumulation with incentive rewards #5872
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.
Needs second ACK due to change with incentives.go, but LGTM
…ialized and deserialized (#5873)
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.
Core changes LGTM! Did slightly more cursory review of tests but they generally look good (will try to do another pass later to make sure the changes are covered but shouldn't be blocking)
I think theres some merge conflict issues with the other PR, PR LGTM assuming these are resolved |
Progress towards: #5854
What is the purpose of the change
Please review #5869 first for better context and easier review experience.
This PR fixes a negative interval accumulation edge case bug by simply replacing Sub with SafeSub where applicable. It introduces new coming helpers in
osmoutils
to achieve that.The tests are extended to cover claiming rewards below, inside, and above the position after it is initialized.
Note, I noticed another edge case around negative values while working on this. Added docs to explain it. It is covered by current test
Testing and Verifying
The global invariants are asserted, and the tests ensure that the appropriate amount is claimed from all positions in all cases.
Documentation and Release Note
Unreleased
section ofCHANGELOG.md
?Where is the change documented?
x/{module}/README.md
)