Skip to content

Commit

Permalink
chore: remove ethers rng utils
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-aranha-cw committed Feb 4, 2025
1 parent 3122472 commit e7ae2fc
Show file tree
Hide file tree
Showing 20 changed files with 20 additions and 18 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ paste = "=1.0.15"
phf = "=0.11.2"
pin-project = "=1.1.5"
rand = { version = "=0.8.5", features = ["small_rng"] }
rand_core = "=0.6.4"
rust_decimal = "=1.36.0"
rustc-hash = "=2.0.0"
smallvec = "=1.13.2"
Expand Down
2 changes: 1 addition & 1 deletion src/eth/primitives/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl Display for Address {
}

impl Dummy<Faker> for Address {
fn dummy_with_rng<R: ethers_core::rand::prelude::Rng + ?Sized>(_: &Faker, rng: &mut R) -> Self {
fn dummy_with_rng<R: rand_core::RngCore + ?Sized>(_: &Faker, rng: &mut R) -> Self {
H160::random_using(rng).into()
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/eth/primitives/block_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl BlockHeader {
}

impl Dummy<Faker> for BlockHeader {
fn dummy_with_rng<R: ethers_core::rand::prelude::Rng + ?Sized>(faker: &Faker, rng: &mut R) -> Self {
fn dummy_with_rng<R: rand_core::RngCore + ?Sized>(faker: &Faker, rng: &mut R) -> Self {
Self {
number: faker.fake_with_rng(rng),
hash: faker.fake_with_rng(rng),
Expand Down
2 changes: 1 addition & 1 deletion src/eth/primitives/block_number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl BlockNumber {
}

impl Dummy<Faker> for BlockNumber {
fn dummy_with_rng<R: ethers_core::rand::prelude::Rng + ?Sized>(_: &Faker, rng: &mut R) -> Self {
fn dummy_with_rng<R: rand_core::RngCore + ?Sized>(_: &Faker, rng: &mut R) -> Self {
rng.next_u64().into()
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/eth/primitives/chain_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::gen_newtype_try_from;
pub struct ChainId(pub U64);

impl Dummy<Faker> for ChainId {
fn dummy_with_rng<R: ethers_core::rand::prelude::Rng + ?Sized>(_: &Faker, rng: &mut R) -> Self {
fn dummy_with_rng<R: rand_core::RngCore + ?Sized>(_: &Faker, rng: &mut R) -> Self {
rng.next_u64().into()
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/eth/primitives/code_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::gen_newtype_from;
pub struct CodeHash(pub H256);

impl Dummy<Faker> for CodeHash {
fn dummy_with_rng<R: ethers_core::rand::prelude::Rng + ?Sized>(_: &Faker, rng: &mut R) -> Self {
fn dummy_with_rng<R: rand_core::RngCore + ?Sized>(_: &Faker, rng: &mut R) -> Self {
Self(H256::random_using(rng))
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/eth/primitives/difficulty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::gen_newtype_from;
pub struct Difficulty(pub U256);

impl Dummy<Faker> for Difficulty {
fn dummy_with_rng<R: ethers_core::rand::prelude::Rng + ?Sized>(_: &Faker, rng: &mut R) -> Self {
fn dummy_with_rng<R: rand_core::RngCore + ?Sized>(_: &Faker, rng: &mut R) -> Self {
rng.next_u64().into()
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/eth/primitives/execution_result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub enum ExecutionResult {
pub struct RevertReason(pub Cow<'static, str>);

impl fake::Dummy<Faker> for RevertReason {
fn dummy_with_rng<R: ethers_core::rand::prelude::Rng + ?Sized>(_: &Faker, _rng: &mut R) -> Self {
fn dummy_with_rng<R: rand_core::RngCore + ?Sized>(_: &Faker, _rng: &mut R) -> Self {
RevertReason(Cow::Borrowed("reverted"))
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/eth/primitives/gas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl Gas {
}

impl Dummy<Faker> for Gas {
fn dummy_with_rng<R: ethers_core::rand::prelude::Rng + ?Sized>(_: &Faker, rng: &mut R) -> Self {
fn dummy_with_rng<R: rand_core::RngCore + ?Sized>(_: &Faker, rng: &mut R) -> Self {
rng.next_u64().into()
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/eth/primitives/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl Display for Hash {
}

impl Dummy<Faker> for Hash {
fn dummy_with_rng<R: ethers_core::rand::prelude::Rng + ?Sized>(_: &Faker, rng: &mut R) -> Self {
fn dummy_with_rng<R: rand_core::RngCore + ?Sized>(_: &Faker, rng: &mut R) -> Self {
H256::random_using(rng).into()
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/eth/primitives/log_topic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl Display for LogTopic {
}

impl Dummy<Faker> for LogTopic {
fn dummy_with_rng<R: ethers_core::rand::prelude::Rng + ?Sized>(_: &Faker, rng: &mut R) -> Self {
fn dummy_with_rng<R: rand_core::RngCore + ?Sized>(_: &Faker, rng: &mut R) -> Self {
Self(H256::random_using(rng))
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/eth/primitives/miner_nonce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::gen_newtype_from;
pub struct MinerNonce(H64);

impl Dummy<Faker> for MinerNonce {
fn dummy_with_rng<R: ethers_core::rand::prelude::Rng + ?Sized>(_: &Faker, rng: &mut R) -> Self {
fn dummy_with_rng<R: rand_core::RngCore + ?Sized>(_: &Faker, rng: &mut R) -> Self {
H64::random_using(rng).into()
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/eth/primitives/nonce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl Nonce {
}

impl Dummy<Faker> for Nonce {
fn dummy_with_rng<R: ethers_core::rand::prelude::Rng + ?Sized>(_: &Faker, rng: &mut R) -> Self {
fn dummy_with_rng<R: rand_core::RngCore + ?Sized>(_: &Faker, rng: &mut R) -> Self {
rng.next_u64().into()
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/eth/primitives/size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::gen_newtype_from;
pub struct Size(U64);

impl Dummy<Faker> for Size {
fn dummy_with_rng<R: ethers_core::rand::prelude::Rng + ?Sized>(_: &Faker, rng: &mut R) -> Self {
fn dummy_with_rng<R: rand_core::RngCore + ?Sized>(_: &Faker, rng: &mut R) -> Self {
rng.next_u64().into()
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/eth/primitives/slot_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl SlotIndex {
}

impl Dummy<Faker> for SlotIndex {
fn dummy_with_rng<R: ethers_core::rand::prelude::Rng + ?Sized>(_: &Faker, rng: &mut R) -> Self {
fn dummy_with_rng<R: rand_core::RngCore + ?Sized>(_: &Faker, rng: &mut R) -> Self {
rng.next_u64().into()
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/eth/primitives/slot_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl Display for SlotValue {
}

impl Dummy<Faker> for SlotValue {
fn dummy_with_rng<R: ethers_core::rand::prelude::Rng + ?Sized>(_: &Faker, rng: &mut R) -> Self {
fn dummy_with_rng<R: rand_core::RngCore + ?Sized>(_: &Faker, rng: &mut R) -> Self {
rng.next_u64().into()
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/eth/primitives/transaction_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub struct TransactionInput {
}

impl Dummy<Faker> for TransactionInput {
fn dummy_with_rng<R: ethers_core::rand::prelude::Rng + ?Sized>(faker: &Faker, rng: &mut R) -> Self {
fn dummy_with_rng<R: rand_core::RngCore + ?Sized>(faker: &Faker, rng: &mut R) -> Self {
Self {
tx_type: Some(rng.next_u64().into()),
chain_id: faker.fake_with_rng(rng),
Expand Down
2 changes: 1 addition & 1 deletion src/eth/primitives/unix_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl Deref for UnixTime {
}

impl Dummy<Faker> for UnixTime {
fn dummy_with_rng<R: ethers_core::rand::prelude::Rng + ?Sized>(_: &Faker, rng: &mut R) -> Self {
fn dummy_with_rng<R: rand_core::RngCore + ?Sized>(_: &Faker, rng: &mut R) -> Self {
rng.next_u64().into()
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/eth/primitives/wei.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl Wei {
}

impl Dummy<Faker> for Wei {
fn dummy_with_rng<R: ethers_core::rand::prelude::Rng + ?Sized>(_: &Faker, rng: &mut R) -> Self {
fn dummy_with_rng<R: rand_core::RngCore + ?Sized>(_: &Faker, rng: &mut R) -> Self {
rng.next_u64().into()
}
}
Expand Down

0 comments on commit e7ae2fc

Please sign in to comment.