-
Notifications
You must be signed in to change notification settings - Fork 154
Migrate remaining_amounts module to alloy #3968
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
Conversation
88acad1 to
d8e7b42
Compare
4d35dd4 to
ec80107
Compare
| /// Multiplies a ratio by a scalar, returning `None` only if the result | ||
| /// would overflow a `U256`, but intermediate operations are allowed to | ||
| /// overflow. | ||
| fn full_scalar_mul(&self, scalar: N) -> Option<N>; |
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.
With alloy's number types being so efficient I wonder if this shouldn't just be the default behavior.
Usually the only reason why one would want intermediate overflows to cause errors is when you try to model the behavior of a smart contract that does that. This is not the case here.
Fine to merge without addressing this since this is a faithful conversion of the existing code.
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.
Default behaviour for what though?
Description
Migrates the remaining_amounts module to alloy.
Note: a big chunk of the diff was just moving the Remaining impl closer to the struct, the diff is just eh at noticing.
Changes
How to test
Existing tests