-
Notifications
You must be signed in to change notification settings - Fork 18
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
Adjust transaction retry from timestamp calculation #1044
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/cuttlefish #1044 +/- ##
====================================================
Coverage 42.4% 42.5%
- Complexity 4624 4627 +3
====================================================
Files 1782 1782
Lines 55167 55175 +8
Branches 1524 1524
====================================================
+ Hits 23406 23450 +44
+ Misses 31282 31248 -34
+ Partials 479 477 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Docker tags |
multiplier_range: core::ops::Range<f32>, | ||
) -> Self { | ||
Self::calculated_or_never(|| { | ||
let multiplier: f32 = 2.0_f32.powf(exponent).clamp(multiplier_range.start, multiplier_range.end); |
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.
maybe better to clamp exponent instead?
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.
Out of interest, why do you think it would be better?
I actually originally had a clamp of the exponent, but I changed to clamping the multiplier as it felt more declarative / easier to understand; but maybe that assumption is wrong! I'm happy to change back though if you prefer?
For what it's worth, (2^100) = +Inf
, which clamps to multiplier_range.end
- will add some unit tests for this though.
…ger` This makes the logic easier to follow and verify.
|
Summary
Testing
Test was added; related code was also refactored.