-
Notifications
You must be signed in to change notification settings - Fork 48
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: Add more tests for light_utils
main module
#846
Conversation
0cf0ec3
to
776f078
Compare
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 776f078. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 2 targetsSent with 💌 from NxCloud. |
776f078
to
f03082b
Compare
Achieve full coverage there.
f03082b
to
b94e701
Compare
utils/src/lib.rs
Outdated
let max_input = [u8::MAX; 32]; | ||
let (hashed_value, bump) = hash_to_bn254_field_size_be(max_input.as_slice()) | ||
.expect("Failed to find a hash within BN254 field size"); | ||
assert_eq!(bump, 255, "Bump seed should be 0"); |
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.
The assert error msg confused me, shouldn't it read as follows?
assert_eq!(bump, 255, "Bump seed should be 0"); | |
assert_eq!(bump, 255, "Bump seed should be 255"); |
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.
You're right
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.
done
let bigint = modulus + 1.to_biguint().unwrap(); | ||
let bigint_bytes: [u8; 32] = bigint_to_be_bytes_array(&bigint).unwrap(); | ||
assert!(!is_smaller_than_bn254_field_size_be(&bigint_bytes)); | ||
} |
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.
nice!
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.
Thanks, just one nitpick in the assert error.
Achieve full coverage there.