-
Notifications
You must be signed in to change notification settings - Fork 54
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: fuzz segments #315
test: fuzz segments #315
Conversation
52254ed
to
1f6c21c
Compare
1968f5a
to
82c69c2
Compare
100c7b9
to
ddec70f
Compare
chore: improve wording in code comments chore: say "has been" instead of "was" chore: say "have been" instead of "were" test: load sender from "users" struct
refactor: rename "checkDeltasAndAdjustSegments" to "checkDeltasAndCalculateMilestones"
test: delete duplicate range assumptions check test: rename "E2eTest" to "E2e_Test"
ddec70f
to
8e4ba0e
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.
Is there any reason why you chose this step?
https://github.com/sablierhq/v2-core/blob/8e4ba0e2b1cc3e8b32498b2aa9cf549d2462b6ea/test/shared/helpers/Calculations.t.sol#L196
test: order correctly the functions in "Calculations" test: move assume cheatcodes from test function to "checkUsers" test: remove unnecessary inherits in "Base_Test" chore: remove unused imports
Assuming that by "step" you meant |
Ok, in this case, they are not really "fuzzed". Only the |
Actually, the milestones are fuzzed:
|
But even if the milestones had not been fuzzed (which is not the case), there would still be value in fuzzing the segment amounts, exponents, and the lengths of the |
test: warp closer to the start of the test functions
cc4f1e3
to
38c735e
Compare
test: add "fuzzSegmentAmountsAndCalculateCreateAmounts" with defaults test: fuzz segments in pro withdraw tests test: fix names of shared withdraw test contracts test: warp in "current milestone 1st" test
38c735e
to
c37fc5f
Compare
@andreivladbrg besides the point above (which I said I will fix in #322), is this PR good to merge? |
Yes |
Awesome, thanks. |
Description
Closes #256 and #326.
Fuzzing the segment amounts and the exponents was easy, as there are no ordering rules that apply in their case. However, deltas and milestones were trickier.
What I did was to generate the milestones using the solidity-generators library, specifically using the
arange
function, and then I bounded each milestone to get a more uneven distribution.Whereas the deltas I generated by iterating over the fuzzed segments and bounding each segment milestone (you read that right, I used the fuzzed segment milestones as the source of entropy for the bounded deltas).