Skip to content
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

Leverage rand_core::RngCore implementations in Rng #60

Merged
merged 3 commits into from
Sep 12, 2022

Conversation

appcypher
Copy link
Member

Summary

Leverage RngCore in Rng implementation

This PR turns Rng random_bytes method into a default method that depends on RngCore implementation. It allows us directly use existing RngCore implementations out there without wrapping them, like proptest TestRng.

Test plan (required)

  • Testing the Rust core.

    cargo test -p wnfs --release
  • Testing the wasm bindings.

    cd crates/wasm
    yarn playwright test

Closing issues

Fixes #55

@codecov-commenter
Copy link

Codecov Report

Merging #60 (bb15880) into main (a38daf5) will decrease coverage by 0.24%.
The diff coverage is 95.65%.

@@            Coverage Diff             @@
##             main      #60      +/-   ##
==========================================
- Coverage   80.09%   79.84%   -0.25%     
==========================================
  Files          28       28              
  Lines        2215     2213       -2     
==========================================
- Hits         1774     1767       -7     
- Misses        441      446       +5     
Impacted Files Coverage Δ
crates/fs/common/utils.rs 78.57% <ø> (-0.60%) ⬇️
crates/fs/private/rng.rs 75.00% <75.00%> (ø)
crates/fs/private/directory.rs 85.96% <100.00%> (ø)
crates/fs/private/forest.rs 82.69% <100.00%> (ø)
crates/fs/private/key.rs 76.00% <100.00%> (ø)
crates/fs/private/namefilter/bloomfilter.rs 85.71% <100.00%> (-0.23%) ⬇️
crates/fs/private/node.rs 72.64% <100.00%> (ø)
crates/fs/common/blockstore.rs 79.31% <0.00%> (-2.84%) ⬇️
crates/fs/private/hamt/node.rs 90.81% <0.00%> (-1.44%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@matheus23 matheus23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean!
🚀

(I really want to pick a gif, but I'm on a restricted network rn :D)

@appcypher appcypher merged commit deeea03 into main Sep 12, 2022
@zeeshanlakhani zeeshanlakhani deleted the appcypher/use-rngcore branch October 19, 2022 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change Custom Rng Trait to rand::RngCore
3 participants