-
Notifications
You must be signed in to change notification settings - Fork 2
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
test: use equality in the withdraw multiple test and in invariant #320
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test: use only withdrawMax
andreivladbrg
changed the title
test: use equality in the withdraw multiple test
test: use equality in the withdraw multiple test and in invariant
Oct 24, 2024
smol-ninja
requested changes
Oct 24, 2024
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.
Excellent observation @andreivladbrg. Left some comments below.
smol-ninja
requested changes
Oct 24, 2024
smol-ninja
approved these changes
Oct 25, 2024
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.
Good to go. I left a comment below in case you want to address it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As we changed the
sd
to 18 decimals, I discovered that the delay explained in the technical doc no longer holds true. The issue that prevented us from identifying the fix earlier was that these tests were giving false positives due to descaling the ongoing debt back to the token's decimals.For example, previously, if the withdrawable amount was 1.99 tokens, the recipient would withdraw 1 token, and the snapshot debt would remain 0, causing a delay for the remaining 0.99 tokens. Now, with the snapshot updated to 0.99, thus there is no delay which is proven by the new test in this branch:
flow/tests/integration/concrete/withdraw-delay/withdrawDelay.t.sol
Lines 10 to 47 in bc6643b