-
Notifications
You must be signed in to change notification settings - Fork 354
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
Minor improvements to Utils package #1206
Minor improvements to Utils package #1206
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1206 +/- ##
==========================================
+ Coverage 92.06% 92.12% +0.05%
==========================================
Files 49 49
Lines 1399 1396 -3
==========================================
- Hits 1288 1286 -2
+ Misses 111 110 -1
Continue to review full report in Codecov by Sentry.
|
fn length(self: StoragePath<Trace>) -> u64 { | ||
self.checkpoints.len() | ||
} | ||
|
||
/// Returns the checkpoint at given position. |
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.
I think position is easier to read here, maybe we can update the param name?
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.
Mmm I honestly like pos
as the param name—unless you prefer a new name? I'll switch the comment back. Looking at it now, I agree position is easier to read
use crate::math::average; | ||
|
||
#[test] | ||
fn test_average_u8(a: u8, b: u8) { |
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.
I noticed that fuzzing actually takes a significant amount of time when running tests, not only in compilation. Did you noticed the same thing?
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.
I did...it's only a few tests though so relative to the whole repo, IMO it's not a huge deal. If we want to improve performance, we can configure it to a smaller amount either in the tests themselves or globally when running the test cmd i.e. snforge test ... --fuzzer-runs 25
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.
Left a small comment, looks good to me otherwise!
Co-authored-by: Eric Nordelo <eric.nordelo39@gmail.com>
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.
LGTM
PR Checklist
This PR proposes to add fuzz tests for the math module (which only includes the
average
fn ATM)