mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-30 03:01:58 -04:00
chore: alloy 0.14 (#15635)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@@ -53,7 +53,7 @@ async fn can_sync() -> eyre::Result<()> {
|
||||
async fn e2e_test_send_transactions() -> eyre::Result<()> {
|
||||
reth_tracing::init_test_tracing();
|
||||
|
||||
let seed: [u8; 32] = rand::thread_rng().gen();
|
||||
let seed: [u8; 32] = rand::rng().random();
|
||||
let mut rng = StdRng::from_seed(seed);
|
||||
println!("Seed: {:?}", seed);
|
||||
|
||||
@@ -89,7 +89,7 @@ async fn e2e_test_send_transactions() -> eyre::Result<()> {
|
||||
async fn test_long_reorg() -> eyre::Result<()> {
|
||||
reth_tracing::init_test_tracing();
|
||||
|
||||
let seed: [u8; 32] = rand::thread_rng().gen();
|
||||
let seed: [u8; 32] = rand::rng().random();
|
||||
let mut rng = StdRng::from_seed(seed);
|
||||
println!("Seed: {:?}", seed);
|
||||
|
||||
@@ -139,7 +139,7 @@ async fn test_long_reorg() -> eyre::Result<()> {
|
||||
async fn test_reorg_through_backfill() -> eyre::Result<()> {
|
||||
reth_tracing::init_test_tracing();
|
||||
|
||||
let seed: [u8; 32] = rand::thread_rng().gen();
|
||||
let seed: [u8; 32] = rand::rng().random();
|
||||
let mut rng = StdRng::from_seed(seed);
|
||||
println!("Seed: {:?}", seed);
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ alloy_sol_types::sol! {
|
||||
async fn test_fee_history() -> eyre::Result<()> {
|
||||
reth_tracing::init_test_tracing();
|
||||
|
||||
let seed: [u8; 32] = rand::thread_rng().gen();
|
||||
let seed: [u8; 32] = rand::rng().random();
|
||||
let mut rng = StdRng::from_seed(seed);
|
||||
println!("Seed: {:?}", seed);
|
||||
|
||||
@@ -71,8 +71,9 @@ async fn test_fee_history() -> eyre::Result<()> {
|
||||
assert_eq!(block.header.base_fee_per_gas.unwrap(), expected_first_base_fee as u64);
|
||||
|
||||
for _ in 0..100 {
|
||||
let _ =
|
||||
GasWaster::deploy_builder(&provider, U256::from(rng.gen_range(0..1000))).send().await?;
|
||||
let _ = GasWaster::deploy_builder(&provider, U256::from(rng.random_range(0..1000)))
|
||||
.send()
|
||||
.await?;
|
||||
|
||||
node.advance_block().await?;
|
||||
}
|
||||
@@ -80,8 +81,8 @@ async fn test_fee_history() -> eyre::Result<()> {
|
||||
let latest_block = provider.get_block_number().await?;
|
||||
|
||||
for _ in 0..100 {
|
||||
let latest_block = rng.gen_range(0..=latest_block);
|
||||
let block_count = rng.gen_range(1..=(latest_block + 1));
|
||||
let latest_block = rng.random_range(0..=latest_block);
|
||||
let block_count = rng.random_range(1..=(latest_block + 1));
|
||||
|
||||
let fee_history = provider.get_fee_history(block_count, latest_block.into(), &[]).await?;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ use alloy_provider::{
|
||||
use alloy_rpc_types_engine::PayloadAttributes;
|
||||
use alloy_rpc_types_eth::TransactionRequest;
|
||||
use alloy_signer::SignerSync;
|
||||
use rand::{seq::SliceRandom, Rng};
|
||||
use rand::{seq::IndexedRandom, Rng};
|
||||
use reth_e2e_test_utils::{wallet::Wallet, NodeHelperType, TmpDB};
|
||||
use reth_ethereum_engine_primitives::EthPayloadBuilderAttributes;
|
||||
use reth_ethereum_primitives::TxType;
|
||||
@@ -47,12 +47,12 @@ where
|
||||
let mut call_destinations = signers.iter().map(|s| s.address()).collect::<Vec<_>>();
|
||||
|
||||
for _ in 0..num_blocks {
|
||||
let tx_count = rng.gen_range(1..20);
|
||||
let tx_count = rng.random_range(1..20);
|
||||
|
||||
let mut pending = vec![];
|
||||
for _ in 0..tx_count {
|
||||
let signer = signers.choose(rng).unwrap();
|
||||
let tx_type = TxType::try_from(rng.gen_range(0..=4) as u64).unwrap();
|
||||
let tx_type = TxType::try_from(rng.random_range(0..=4) as u64).unwrap();
|
||||
|
||||
let nonce = provider
|
||||
.get_transaction_count(signer.address())
|
||||
@@ -63,12 +63,12 @@ where
|
||||
TransactionRequest::default().with_from(signer.address()).with_nonce(nonce);
|
||||
|
||||
let should_create =
|
||||
rng.gen::<bool>() && tx_type != TxType::Eip4844 && tx_type != TxType::Eip7702;
|
||||
rng.random::<bool>() && tx_type != TxType::Eip4844 && tx_type != TxType::Eip7702;
|
||||
if should_create {
|
||||
tx = tx.into_create().with_input(dummy_bytecode.clone());
|
||||
} else {
|
||||
tx = tx.with_to(*call_destinations.choose(rng).unwrap()).with_input(
|
||||
(0..rng.gen_range(0..10000)).map(|_| rng.gen()).collect::<Vec<u8>>(),
|
||||
(0..rng.random_range(0..10000)).map(|_| rng.random()).collect::<Vec<u8>>(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -76,11 +76,11 @@ where
|
||||
tx = tx.with_gas_price(provider.get_gas_price().await?);
|
||||
}
|
||||
|
||||
if rng.gen::<bool>() || tx_type == TxType::Eip2930 {
|
||||
if rng.random::<bool>() || tx_type == TxType::Eip2930 {
|
||||
tx = tx.with_access_list(
|
||||
vec![AccessListItem {
|
||||
address: *call_destinations.choose(rng).unwrap(),
|
||||
storage_keys: (0..rng.gen_range(0..100)).map(|_| rng.gen()).collect(),
|
||||
storage_keys: (0..rng.random_range(0..100)).map(|_| rng.random()).collect(),
|
||||
}]
|
||||
.into(),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user