From 5194bcfbcc0e81f1defbfaecefa1c6780e0f83c5 Mon Sep 17 00:00:00 2001 From: nk_ysg Date: Sat, 7 Sep 2024 17:11:29 +0800 Subject: [PATCH] testing: clean up reth-primitives import (#10760) --- Cargo.lock | 2 ++ testing/ef-tests/Cargo.toml | 1 + testing/ef-tests/src/models.rs | 5 +++-- testing/testing-utils/Cargo.toml | 1 + testing/testing-utils/src/generators.rs | 6 +++--- testing/testing-utils/src/genesis_allocator.rs | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 25ff7a663..2ad70cf32 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2550,6 +2550,7 @@ dependencies = [ name = "ef-tests" version = "1.0.6" dependencies = [ + "alloy-primitives", "alloy-rlp", "rayon", "reth-chainspec", @@ -8698,6 +8699,7 @@ version = "1.0.6" dependencies = [ "alloy-eips", "alloy-genesis", + "alloy-primitives", "rand 0.8.5", "reth-primitives", "secp256k1", diff --git a/testing/ef-tests/Cargo.toml b/testing/ef-tests/Cargo.toml index 74206884a..ca23ffcce 100644 --- a/testing/ef-tests/Cargo.toml +++ b/testing/ef-tests/Cargo.toml @@ -25,6 +25,7 @@ reth-stages.workspace = true reth-evm-ethereum.workspace = true alloy-rlp.workspace = true +alloy-primitives.workspace = true walkdir = "2.3.3" serde.workspace = true diff --git a/testing/ef-tests/src/models.rs b/testing/ef-tests/src/models.rs index e7556ec0d..3021f8cb7 100644 --- a/testing/ef-tests/src/models.rs +++ b/testing/ef-tests/src/models.rs @@ -1,6 +1,7 @@ //! Shared models for use crate::{assert::assert_equal, Error}; +use alloy_primitives::{Address, Bloom, Bytes, B256, B64, U256}; use reth_chainspec::{ChainSpec, ChainSpecBuilder}; use reth_db::tables; use reth_db_api::{ @@ -8,8 +9,8 @@ use reth_db_api::{ transaction::{DbTx, DbTxMut}, }; use reth_primitives::{ - keccak256, Account as RethAccount, Address, Bloom, Bytecode, Bytes, Header as RethHeader, - SealedHeader, StorageEntry, Withdrawals, B256, B64, U256, + keccak256, Account as RethAccount, Bytecode, Header as RethHeader, SealedHeader, StorageEntry, + Withdrawals, }; use serde::Deserialize; use std::{collections::BTreeMap, ops::Deref}; diff --git a/testing/testing-utils/Cargo.toml b/testing/testing-utils/Cargo.toml index 182d01baf..af592e294 100644 --- a/testing/testing-utils/Cargo.toml +++ b/testing/testing-utils/Cargo.toml @@ -16,6 +16,7 @@ reth-primitives = { workspace = true, features = ["secp256k1"] } alloy-eips.workspace = true alloy-genesis.workspace = true +alloy-primitives.workspace = true rand.workspace = true secp256k1 = { workspace = true, features = ["rand"] } diff --git a/testing/testing-utils/src/generators.rs b/testing/testing-utils/src/generators.rs index 0c50a58d7..334df3ef3 100644 --- a/testing/testing-utils/src/generators.rs +++ b/testing/testing-utils/src/generators.rs @@ -3,14 +3,14 @@ use alloy_eips::{ eip6110::DepositRequest, eip7002::WithdrawalRequest, eip7251::ConsolidationRequest, }; +use alloy_primitives::{Address, BlockNumber, Bytes, TxKind, B256, U256}; pub use rand::Rng; use rand::{ distributions::uniform::SampleRange, rngs::StdRng, seq::SliceRandom, thread_rng, SeedableRng, }; use reth_primitives::{ - proofs, sign_message, Account, Address, BlockNumber, Bytes, Header, Log, Receipt, Request, - Requests, SealedBlock, SealedHeader, StorageEntry, Transaction, TransactionSigned, TxKind, - TxLegacy, Withdrawal, Withdrawals, B256, U256, + proofs, sign_message, Account, Header, Log, Receipt, Request, Requests, SealedBlock, + SealedHeader, StorageEntry, Transaction, TransactionSigned, TxLegacy, Withdrawal, Withdrawals, }; use secp256k1::{Keypair, Secp256k1}; use std::{ diff --git a/testing/testing-utils/src/genesis_allocator.rs b/testing/testing-utils/src/genesis_allocator.rs index a146401f0..8a5adb300 100644 --- a/testing/testing-utils/src/genesis_allocator.rs +++ b/testing/testing-utils/src/genesis_allocator.rs @@ -2,7 +2,8 @@ //! signers to the genesis block. use alloy_genesis::GenesisAccount; -use reth_primitives::{public_key_to_address, Address, Bytes, B256, U256}; +use alloy_primitives::{Address, Bytes, B256, U256}; +use reth_primitives::public_key_to_address; use secp256k1::{ rand::{thread_rng, RngCore}, Keypair, Secp256k1,