foundry-rs / foundry-rs/foundry

feat(`cheatcodes`): add ability to switch between `proptest::test_runner::TestRng` and `rand::rngs::StdRng`

Open
#9,626 0 comments 0 reactions 0 assignees View on GitHub
A-internals T-feature
Dominant language
Rust
Stars
10.6k
Forks
2.6k
Avg merge
18h 20m
Merged PRs (30d)
510

Description

### Component

Forge

### Describe the feature you would like

In #8882, `StdRng` has been replaced by `TestRng`, but `TestRng` does not implement the `CryptoRng` trait. Because of this I can't just pass `TestRng` in some places and I have to explicitly use `rand_chacha::ChaChaRng`? For example, I want to port some crypto library from Rust to Solidity and I have to go into the `proptest` code, understand that `TestRng` does not implement `CryptoRng` and then copy the code from `proptest` which is based on `rand_chacha::ChaChaRng`. Maybe it makes sense to create a crate like `forge-rng` that would also implement `CryptoRng` and other traits. It might also make sense to allow switching between `forge-rng` and `StdRng`.

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.