Skip to content

Commit

Permalink
primitives: rm alloy_eips::eip2930 reexports (#11188)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger committed Sep 25, 2024
1 parent dba6c01 commit 2b20a0d
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 25 deletions.
9 changes: 4 additions & 5 deletions crates/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,10 @@ pub use transaction::BlobTransactionValidationError;

pub use transaction::{
util::secp256k1::{public_key_to_address, recover_signer_unchecked, sign_message},
AccessList, AccessListItem, IntoRecoveredTransaction, InvalidTransactionError, Signature,
Transaction, TransactionMeta, TransactionSigned, TransactionSignedEcRecovered,
TransactionSignedNoHash, TxEip1559, TxEip2930, TxEip4844, TxEip7702, TxHashOrNumber, TxLegacy,
TxType, EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID,
LEGACY_TX_TYPE_ID,
IntoRecoveredTransaction, InvalidTransactionError, Signature, Transaction, TransactionMeta,
TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash, TxEip1559, TxEip2930,
TxEip4844, TxEip7702, TxHashOrNumber, TxLegacy, TxType, EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID,
EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID, LEGACY_TX_TYPE_ID,
};

// Re-exports
Expand Down
6 changes: 1 addition & 5 deletions crates/primitives/src/transaction/access_list.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
//! [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930): Access List types

/// Re-export from `alloy_eips`.
#[doc(inline)]
pub use alloy_eips::eip2930::{AccessList, AccessListItem, AccessListResult};

#[cfg(test)]
mod tests {
use super::*;
use crate::{Address, B256};
use alloy_eips::eip2930::{AccessList, AccessListItem};
use alloy_rlp::{RlpDecodable, RlpDecodableWrapper, RlpEncodable, RlpEncodableWrapper};
use proptest::proptest;
use proptest_arbitrary_interop::arb;
Expand Down
3 changes: 1 addition & 2 deletions crates/primitives/src/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use crate::{keccak256, Address, BlockHashOrNumber, Bytes, TxHash, TxKind, B256,
use alloy_eips::eip7702::SignedAuthorization;

use alloy_consensus::SignableTransaction;
use alloy_eips::eip2930::AccessList;
use alloy_primitives::Parity;
use alloy_rlp::{
Decodable, Encodable, Error as RlpError, Header, EMPTY_LIST_CODE, EMPTY_STRING_CODE,
Expand All @@ -16,8 +17,6 @@ use rayon::prelude::{IntoParallelIterator, ParallelIterator};
use serde::{Deserialize, Serialize};
use signature::{decode_with_eip155_chain_id, with_eip155_parity};

pub use access_list::{AccessList, AccessListItem, AccessListResult};

pub use alloy_consensus::{TxEip1559, TxEip2930, TxEip4844, TxEip7702, TxLegacy};

pub use error::{
Expand Down
3 changes: 2 additions & 1 deletion crates/rpc/rpc-eth-api/src/core.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Implementation of the [`jsonrpsee`] generated [`EthApiServer`] trait. Handles RPC requests for
//! the `eth_` namespace.
use alloy_dyn_abi::TypedData;
use alloy_eips::eip2930::AccessListResult;
use alloy_json_rpc::RpcObject;
use alloy_primitives::{Address, Bytes, B256, B64, U256, U64};
use alloy_rpc_types::{
Expand All @@ -12,7 +13,7 @@ use alloy_rpc_types::{
};
use alloy_rpc_types_eth::transaction::TransactionRequest;
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use reth_primitives::{transaction::AccessListResult, BlockId, BlockNumberOrTag};
use reth_primitives::{BlockId, BlockNumberOrTag};
use reth_rpc_server_types::{result::internal_rpc_err, ToRpcResult};
use tracing::trace;

Expand Down
3 changes: 1 addition & 2 deletions crates/rpc/rpc-eth-api/src/helpers/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use crate::{
AsEthApiError, FromEthApiError, FromEvmError, FullEthApiTypes, IntoEthApiError, RpcBlock,
};
use alloy_eips::eip1559::calc_next_block_base_fee;
use alloy_eips::{eip1559::calc_next_block_base_fee, eip2930::AccessListResult};
use alloy_primitives::{Bytes, TxKind, B256, U256};
use alloy_rpc_types::{
simulate::{SimBlock, SimulatePayload, SimulatedBlock},
Expand All @@ -20,7 +20,6 @@ use reth_primitives::{
BlockEnv, CfgEnvWithHandlerCfg, EnvWithHandlerCfg, ExecutionResult, HaltReason,
ResultAndState, TransactTo, TxEnv,
},
transaction::AccessListResult,
Header, TransactionSignedEcRecovered,
};
use reth_provider::{ChainSpecProvider, HeaderProvider, StateProvider};
Expand Down
5 changes: 3 additions & 2 deletions crates/transaction-pool/src/test_utils/gen.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use crate::EthPooledTransaction;
use alloy_eips::eip2930::AccessList;
use alloy_primitives::{Address, B256, U256};
use rand::Rng;
use reth_chainspec::MAINNET;
use reth_primitives::{
constants::MIN_PROTOCOL_BASE_FEE, sign_message, AccessList, Bytes, Transaction,
TransactionSigned, TxEip1559, TxEip4844, TxKind, TxLegacy,
constants::MIN_PROTOCOL_BASE_FEE, sign_message, Bytes, Transaction, TransactionSigned,
TxEip1559, TxEip4844, TxKind, TxLegacy,
};

/// A generator for transactions for testing purposes.
Expand Down
9 changes: 5 additions & 4 deletions crates/transaction-pool/src/test_utils/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::{
CoinbaseTipOrdering, EthBlobTransactionSidecar, EthPoolTransaction, PoolTransaction,
ValidPoolTransaction,
};
use alloy_eips::eip2930::AccessList;
use alloy_primitives::{Address, Bytes, ChainId, TxHash, TxKind, B256, U256};
use paste::paste;
use rand::{
Expand All @@ -16,10 +17,10 @@ use rand::{
use reth_primitives::{
constants::{eip4844::DATA_GAS_PER_BLOB, MIN_PROTOCOL_BASE_FEE},
transaction::TryFromRecoveredTransactionError,
AccessList, BlobTransactionSidecar, BlobTransactionValidationError,
PooledTransactionsElementEcRecovered, Signature, Transaction, TransactionSigned,
TransactionSignedEcRecovered, TxEip1559, TxEip2930, TxEip4844, TxLegacy, TxType,
EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID, LEGACY_TX_TYPE_ID,
BlobTransactionSidecar, BlobTransactionValidationError, PooledTransactionsElementEcRecovered,
Signature, Transaction, TransactionSigned, TransactionSignedEcRecovered, TxEip1559, TxEip2930,
TxEip4844, TxLegacy, TxType, EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID,
LEGACY_TX_TYPE_ID,
};

use std::{ops::Range, sync::Arc, time::Instant, vec::IntoIter};
Expand Down
6 changes: 3 additions & 3 deletions crates/transaction-pool/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ use crate::{
validate::ValidPoolTransaction,
AllTransactionsEvents,
};
use alloy_eips::eip4844::BlobAndProofV1;
use alloy_eips::{eip2930::AccessList, eip4844::BlobAndProofV1};
use alloy_primitives::{Address, TxHash, TxKind, B256, U256};
use futures_util::{ready, Stream};
use reth_eth_wire_types::HandleMempoolData;
use reth_execution_types::ChangedAccount;
use reth_primitives::{
kzg::KzgSettings, transaction::TryFromRecoveredTransactionError, AccessList,
BlobTransactionSidecar, BlobTransactionValidationError, PooledTransactionsElement,
kzg::KzgSettings, transaction::TryFromRecoveredTransactionError, BlobTransactionSidecar,
BlobTransactionValidationError, PooledTransactionsElement,
PooledTransactionsElementEcRecovered, SealedBlock, Transaction, TransactionSignedEcRecovered,
EIP1559_TX_TYPE_ID, EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID,
};
Expand Down
3 changes: 2 additions & 1 deletion testing/testing-utils/src/generators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,9 @@ pub fn random_request<R: Rng>(rng: &mut R) -> Request {
#[cfg(test)]
mod tests {
use super::*;
use alloy_eips::eip2930::AccessList;
use alloy_primitives::Parity;
use reth_primitives::{hex, public_key_to_address, AccessList, Signature, TxEip1559};
use reth_primitives::{hex, public_key_to_address, Signature, TxEip1559};
use std::str::FromStr;

#[test]
Expand Down

0 comments on commit 2b20a0d

Please sign in to comment.