primitives: rm more alloy_primitives reexports (#11222)

This commit is contained in:
Thomas Coratger
2024-09-26 13:29:18 +02:00
committed by GitHub
parent edd8fe4648
commit f2a508df34
64 changed files with 146 additions and 104 deletions

View File

@ -1,12 +1,12 @@
use crate::{
Address, Bytes, GotExpected, Header, SealedHeader, TransactionSigned,
TransactionSignedEcRecovered, Withdrawals, B256,
Bytes, GotExpected, Header, SealedHeader, TransactionSigned, TransactionSignedEcRecovered,
Withdrawals, B256,
};
use alloc::vec::Vec;
pub use alloy_eips::eip1898::{
BlockHashOrNumber, BlockId, BlockNumHash, BlockNumberOrTag, ForkBlock, RpcBlockHash,
};
use alloy_primitives::Sealable;
use alloy_primitives::{Address, Sealable};
use alloy_rlp::{Decodable, Encodable, RlpDecodable, RlpEncodable};
use derive_more::{Deref, DerefMut};
#[cfg(any(test, feature = "arbitrary"))]

View File

@ -72,10 +72,9 @@ pub use transaction::{
pub use alloy_primitives::{
self, address, b256, bloom, bytes,
bytes::{Buf, BufMut, BytesMut},
eip191_hash_message, hex, hex_literal, keccak256, ruint,
hex, hex_literal, ruint,
utils::format_ether,
Address, BlockHash, BlockNumber, Bloom, BloomInput, Bytes, ChainId, Selector, StorageKey,
StorageValue, TxHash, TxIndex, TxNumber, B128, B256, B512, B64, U128, U256, U64, U8,
Bytes, StorageValue, TxHash, TxIndex, TxNumber, B128, B256, B512, B64, U128, U256, U64,
};
pub use reth_ethereum_forks::*;
pub use revm_primitives::{self, JumpTable};

View File

@ -1,11 +1,12 @@
//! Helper function for calculating Merkle proofs and hashes.
use crate::{
constants::EMPTY_OMMER_ROOT_HASH, keccak256, Header, Receipt, ReceiptWithBloom,
ReceiptWithBloomRef, Request, TransactionSigned, Withdrawal, B256,
constants::EMPTY_OMMER_ROOT_HASH, Header, Receipt, ReceiptWithBloom, ReceiptWithBloomRef,
Request, TransactionSigned, Withdrawal, B256,
};
use alloc::vec::Vec;
use alloy_eips::eip7685::Encodable7685;
use alloy_primitives::keccak256;
use reth_trie_common::root::{ordered_trie_root, ordered_trie_root_with_encoder};
/// Calculate a transaction root.

View File

@ -1,11 +1,11 @@
#[cfg(feature = "reth-codec")]
use crate::compression::{RECEIPT_COMPRESSOR, RECEIPT_DECOMPRESSOR};
use crate::{
logs_bloom, Bloom, Bytes, TxType, B256, EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID,
EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID,
logs_bloom, Bytes, TxType, B256, EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID,
EIP7702_TX_TYPE_ID,
};
use alloc::{vec, vec::Vec};
use alloy_primitives::Log;
use alloy_primitives::{Bloom, Log};
use alloy_rlp::{length_of_length, Decodable, Encodable, RlpDecodable, RlpEncodable};
use bytes::{Buf, BufMut};
use core::{cmp::Ordering, ops::Deref};

View File

@ -2,8 +2,9 @@
#[cfg(test)]
mod tests {
use crate::{Address, B256};
use crate::B256;
use alloy_eips::eip2930::{AccessList, AccessListItem};
use alloy_primitives::Address;
use alloy_rlp::{RlpDecodable, RlpDecodableWrapper, RlpEncodable, RlpEncodableWrapper};
use proptest::proptest;
use proptest_arbitrary_interop::arb;

View File

@ -1,5 +1,5 @@
use crate::{Address, Transaction, TransactionSigned, U256};
use alloy_primitives::TxKind;
use crate::{Transaction, TransactionSigned, U256};
use alloy_primitives::{Address, TxKind};
use revm_primitives::{AuthorizationList, TxEnv};
/// Implements behaviour to fill a [`TxEnv`] from another transaction.

View File

@ -1,8 +1,8 @@
//! Transaction types.
use crate::{keccak256, Address, BlockHashOrNumber, Bytes, TxHash, B256, U256};
use crate::{BlockHashOrNumber, Bytes, TxHash, B256, U256};
use alloy_eips::eip7702::SignedAuthorization;
use alloy_primitives::TxKind;
use alloy_primitives::{keccak256, Address, TxKind};
use alloy_consensus::{SignableTransaction, TxEip1559, TxEip2930, TxEip4844, TxEip7702, TxLegacy};
use alloy_eips::eip2930::AccessList;
@ -1693,10 +1693,10 @@ mod tests {
use crate::{
hex,
transaction::{signature::Signature, TxEip1559, TxKind, TxLegacy},
Address, Bytes, Transaction, TransactionSigned, TransactionSignedEcRecovered,
Bytes, Transaction, TransactionSigned, TransactionSignedEcRecovered,
TransactionSignedNoHash, B256, U256,
};
use alloy_primitives::{address, b256, bytes, Parity};
use alloy_primitives::{address, b256, bytes, Address, Parity};
use alloy_rlp::{Decodable, Encodable, Error as RlpError};
use reth_chainspec::MIN_TRANSACTION_GAS;
use reth_codecs::Compact;

View File

@ -7,14 +7,15 @@ use super::{
TxEip7702,
};
use crate::{
Address, BlobTransaction, BlobTransactionSidecar, Bytes, Signature, Transaction,
TransactionSigned, TransactionSignedEcRecovered, TxHash, B256, EIP4844_TX_TYPE_ID,
BlobTransaction, BlobTransactionSidecar, Bytes, Signature, Transaction, TransactionSigned,
TransactionSignedEcRecovered, TxHash, B256, EIP4844_TX_TYPE_ID,
};
use alloc::vec::Vec;
use alloy_consensus::{
transaction::{TxEip1559, TxEip2930, TxEip4844, TxLegacy},
SignableTransaction, TxEip4844WithSidecar,
};
use alloy_primitives::Address;
use alloy_rlp::{Decodable, Encodable, Error as RlpError, Header, EMPTY_LIST_CODE};
use bytes::Buf;
use derive_more::{AsRef, Deref};

View File

@ -1,7 +1,8 @@
#![cfg_attr(docsrs, doc(cfg(feature = "c-kzg")))]
use crate::{keccak256, Signature, Transaction, TransactionSigned, TxHash, EIP4844_TX_TYPE_ID};
use crate::{Signature, Transaction, TransactionSigned, TxHash, EIP4844_TX_TYPE_ID};
use alloy_consensus::{transaction::TxEip4844, TxEip4844WithSidecar};
use alloy_primitives::keccak256;
use alloy_rlp::{Decodable, Error as RlpError, Header};
use serde::{Deserialize, Serialize};

View File

@ -1,6 +1,5 @@
use crate::{transaction::util::secp256k1, Address, B256, U256};
use alloy_primitives::Parity;
use crate::{transaction::util::secp256k1, B256, U256};
use alloy_primitives::{Address, Parity};
use alloy_rlp::{Decodable, Error as RlpError};
pub use alloy_primitives::Signature;
@ -120,9 +119,9 @@ mod tests {
transaction::signature::{
legacy_parity, recover_signer, recover_signer_unchecked, SECP256K1N_HALF,
},
Address, Signature, B256, U256,
Signature, B256, U256,
};
use alloy_primitives::Parity;
use alloy_primitives::{Address, Parity};
use std::str::FromStr;
#[test]

View File

@ -1,4 +1,5 @@
use crate::{U64, U8};
use crate::U64;
use alloy_primitives::U8;
use alloy_rlp::{Decodable, Encodable};
use serde::{Deserialize, Serialize};

View File

@ -1,4 +1,5 @@
use crate::{Address, Signature};
use crate::Signature;
use alloy_primitives::Address;
use revm_primitives::B256;
#[cfg(feature = "secp256k1")]
@ -14,13 +15,12 @@ pub(crate) mod secp256k1 {
#[cfg(feature = "secp256k1")]
mod impl_secp256k1 {
use super::*;
use crate::keccak256;
pub(crate) use ::secp256k1::Error;
use ::secp256k1::{
ecdsa::{RecoverableSignature, RecoveryId},
Message, PublicKey, SecretKey, SECP256K1,
};
use alloy_primitives::Parity;
use alloy_primitives::{keccak256, Parity};
use revm_primitives::U256;
/// Recovers the address of the sender using secp256k1 pubkey recovery.
@ -65,8 +65,7 @@ mod impl_secp256k1 {
#[cfg_attr(feature = "secp256k1", allow(unused, unreachable_pub))]
mod impl_k256 {
use super::*;
use crate::keccak256;
use alloy_primitives::Parity;
use alloy_primitives::{keccak256, Parity};
pub(crate) use k256::ecdsa::Error;
use k256::ecdsa::{RecoveryId, SigningKey, VerifyingKey};
use revm_primitives::U256;

View File

@ -2,9 +2,9 @@
//! `TransactionSignedEcRecovered`
use crate::{
Address, Transaction, TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash,
B256,
Transaction, TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash, B256,
};
use alloy_primitives::Address;
use core::ops::Deref;
/// Represents various different transaction formats used in reth.