mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-10 23:15:34 -05:00
chore: alloy 0.14 (#15635)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@@ -792,7 +792,8 @@ impl<HttpMiddleware, RpcMiddleware> Builder<HttpMiddleware, RpcMiddleware> {
|
||||
#[cfg(test)]
|
||||
#[expect(missing_docs)]
|
||||
pub fn dummy_name() -> String {
|
||||
let num: u64 = rand::Rng::gen(&mut rand::thread_rng());
|
||||
use rand::Rng;
|
||||
let num: u64 = rand::rng().random();
|
||||
if cfg!(windows) {
|
||||
format!(r"\\.\pipe\my-pipe-{}", num)
|
||||
} else {
|
||||
|
||||
@@ -52,7 +52,7 @@ fn payload_body_roundtrip() {
|
||||
#[test]
|
||||
fn payload_validation_conversion() {
|
||||
let mut rng = generators::rng();
|
||||
let parent = rng.gen();
|
||||
let parent = rng.random();
|
||||
let block = random_block(
|
||||
&mut rng,
|
||||
100,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! An abstraction over ethereum signers.
|
||||
|
||||
use alloy_dyn_abi::TypedData;
|
||||
use alloy_primitives::{Address, PrimitiveSignature as Signature};
|
||||
use alloy_primitives::{Address, Signature};
|
||||
use alloy_rpc_types_eth::TransactionRequest;
|
||||
use dyn_clone::DynClone;
|
||||
use reth_rpc_eth_types::SignError;
|
||||
|
||||
@@ -83,7 +83,6 @@ parking_lot.workspace = true
|
||||
tracing.workspace = true
|
||||
tracing-futures.workspace = true
|
||||
futures.workspace = true
|
||||
rand.workspace = true
|
||||
serde.workspace = true
|
||||
thiserror.workspace = true
|
||||
derive_more.workspace = true
|
||||
@@ -95,6 +94,7 @@ reth-transaction-pool = { workspace = true, features = ["test-utils"] }
|
||||
reth-provider = { workspace = true, features = ["test-utils"] }
|
||||
|
||||
alloy-consensus.workspace = true
|
||||
rand.workspace = true
|
||||
|
||||
jsonrpsee-types.workspace = true
|
||||
jsonrpsee = { workspace = true, features = ["client"] }
|
||||
|
||||
@@ -649,7 +649,7 @@ where
|
||||
let state = state_provider
|
||||
.witness(Default::default(), hashed_state)
|
||||
.map_err(EthApiError::from)?;
|
||||
Ok(ExecutionWitness { state, codes, keys })
|
||||
Ok(ExecutionWitness { state, codes, keys, headers: vec![] })
|
||||
})
|
||||
.await
|
||||
}
|
||||
|
||||
@@ -465,9 +465,10 @@ mod tests {
|
||||
use crate::{EthApi, EthApiBuilder};
|
||||
use alloy_consensus::{Block, BlockBody, Header};
|
||||
use alloy_eips::BlockNumberOrTag;
|
||||
use alloy_primitives::{PrimitiveSignature as Signature, B256, U64};
|
||||
use alloy_primitives::{Signature, B256, U64};
|
||||
use alloy_rpc_types::FeeHistory;
|
||||
use jsonrpsee_types::error::INVALID_PARAMS_CODE;
|
||||
use rand::Rng;
|
||||
use reth_chain_state::CanonStateSubscriptions;
|
||||
use reth_chainspec::{BaseFeeParams, ChainSpec, ChainSpecProvider};
|
||||
use reth_ethereum_primitives::TransactionSigned;
|
||||
@@ -476,7 +477,7 @@ mod tests {
|
||||
use reth_provider::test_utils::{MockEthProvider, NoopProvider};
|
||||
use reth_rpc_eth_api::EthApiServer;
|
||||
use reth_storage_api::{BlockReader, BlockReaderIdExt, StateProviderFactory};
|
||||
use reth_testing_utils::{generators, generators::Rng};
|
||||
use reth_testing_utils::generators;
|
||||
use reth_transaction_pool::test_utils::{testing_pool, TestPool};
|
||||
|
||||
fn build_test_eth_api<
|
||||
@@ -519,11 +520,12 @@ mod tests {
|
||||
let mut parent_hash = B256::default();
|
||||
|
||||
for i in (0..block_count).rev() {
|
||||
let hash = rng.gen();
|
||||
let hash = rng.random();
|
||||
// Note: Generates saner values to avoid invalid overflows later
|
||||
let gas_limit = rng.gen::<u32>() as u64;
|
||||
let base_fee_per_gas: Option<u64> = rng.gen::<bool>().then(|| rng.gen::<u32>() as u64);
|
||||
let gas_used = rng.gen::<u32>() as u64;
|
||||
let gas_limit = rng.random::<u32>() as u64;
|
||||
let base_fee_per_gas: Option<u64> =
|
||||
rng.random::<bool>().then(|| rng.random::<u32>() as u64);
|
||||
let gas_used = rng.random::<u32>() as u64;
|
||||
|
||||
let header = Header {
|
||||
number: newest_block - i,
|
||||
@@ -539,7 +541,7 @@ mod tests {
|
||||
const TOTAL_TRANSACTIONS: usize = 100;
|
||||
let mut transactions = Vec::with_capacity(TOTAL_TRANSACTIONS);
|
||||
for _ in 0..TOTAL_TRANSACTIONS {
|
||||
let random_fee: u128 = rng.gen();
|
||||
let random_fee: u128 = rng.random();
|
||||
|
||||
if let Some(base_fee_per_gas) = header.base_fee_per_gas {
|
||||
let transaction = TransactionSigned::new_unhashed(
|
||||
|
||||
@@ -807,9 +807,9 @@ mod tests {
|
||||
fn test_block_range_iter() {
|
||||
let mut rng = generators::rng();
|
||||
|
||||
let start = rng.gen::<u32>() as u64;
|
||||
let end = start.saturating_add(rng.gen::<u32>() as u64);
|
||||
let step = rng.gen::<u16>() as u64;
|
||||
let start = rng.random::<u32>() as u64;
|
||||
let end = start.saturating_add(rng.random::<u32>() as u64);
|
||||
let step = rng.random::<u16>() as u64;
|
||||
let range = start..=end;
|
||||
let mut iter = BlockRangeInclusiveIter::new(range.clone(), step);
|
||||
let (from, mut end) = iter.next().unwrap();
|
||||
|
||||
@@ -6,7 +6,7 @@ use crate::EthApi;
|
||||
use alloy_dyn_abi::TypedData;
|
||||
use alloy_eips::eip2718::Decodable2718;
|
||||
use alloy_network::{eip2718::Encodable2718, EthereumWallet, TransactionBuilder};
|
||||
use alloy_primitives::{eip191_hash_message, Address, PrimitiveSignature as Signature, B256};
|
||||
use alloy_primitives::{eip191_hash_message, Address, Signature, B256};
|
||||
use alloy_rpc_types_eth::TransactionRequest;
|
||||
use alloy_signer::SignerSync;
|
||||
use alloy_signer_local::PrivateKeySigner;
|
||||
@@ -43,7 +43,7 @@ impl DevSigner {
|
||||
pub fn random_signers<T: Decodable2718>(num: u32) -> Vec<Box<dyn EthSigner<T> + 'static>> {
|
||||
let mut signers = Vec::with_capacity(num as usize);
|
||||
for _ in 0..num {
|
||||
let sk = PrivateKeySigner::random_with(&mut rand::thread_rng());
|
||||
let sk = PrivateKeySigner::random();
|
||||
|
||||
let address = sk.address();
|
||||
let addresses = vec![address];
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
use alloy_consensus::{Transaction as _, TxEnvelope};
|
||||
use alloy_network::{Ethereum, Network};
|
||||
use alloy_primitives::PrimitiveSignature as Signature;
|
||||
use alloy_primitives::Signature;
|
||||
use alloy_rpc_types::TransactionRequest;
|
||||
use alloy_rpc_types_eth::{Transaction, TransactionInfo};
|
||||
use reth_ethereum_primitives::TransactionSigned;
|
||||
|
||||
Reference in New Issue
Block a user