Skip to content

Commit

Permalink
primitives: rm alloy BlobTransactionValidationError reexport (#12311)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger authored Nov 5, 2024
1 parent 5c2e941 commit 15c230b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 17 deletions.
3 changes: 0 additions & 3 deletions crates/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ pub use transaction::{
PooledTransactionsElementEcRecovered,
};

#[cfg(feature = "c-kzg")]
pub use transaction::BlobTransactionValidationError;

pub use transaction::{
util::secp256k1::{public_key_to_address, recover_signer_unchecked, sign_message},
InvalidTransactionError, Transaction, TransactionMeta, TransactionSigned,
Expand Down
2 changes: 0 additions & 2 deletions crates/primitives/src/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ pub use error::{
};
pub use meta::TransactionMeta;
pub use pooled::{PooledTransactionsElement, PooledTransactionsElementEcRecovered};
#[cfg(feature = "c-kzg")]
pub use sidecar::BlobTransactionValidationError;
pub use sidecar::{BlobTransaction, BlobTransactionSidecar};

pub use compat::FillTxEnv;
Expand Down
5 changes: 1 addition & 4 deletions crates/primitives/src/transaction/sidecar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ use serde::{Deserialize, Serialize};
#[doc(inline)]
pub use alloy_eips::eip4844::BlobTransactionSidecar;

#[cfg(feature = "c-kzg")]
pub use alloy_eips::eip4844::BlobTransactionValidationError;

/// A response to `GetPooledTransactions` that includes blob data, their commitments, and their
/// corresponding proofs.
///
Expand Down Expand Up @@ -58,7 +55,7 @@ impl BlobTransaction {
pub fn validate(
&self,
proof_settings: &c_kzg::KzgSettings,
) -> Result<(), BlobTransactionValidationError> {
) -> Result<(), alloy_eips::eip4844::BlobTransactionValidationError> {
self.transaction.validate_blob(proof_settings)
}

Expand Down
3 changes: 2 additions & 1 deletion crates/transaction-pool/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
//! Transaction pool errors
use alloy_eips::eip4844::BlobTransactionValidationError;
use alloy_primitives::{Address, TxHash, U256};
use reth_primitives::{BlobTransactionValidationError, InvalidTransactionError};
use reth_primitives::InvalidTransactionError;

/// Transaction pool result type.
pub type PoolResult<T> = Result<T, PoolError>;
Expand Down
12 changes: 8 additions & 4 deletions crates/transaction-pool/src/test_utils/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ use alloy_consensus::{
constants::{EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID, LEGACY_TX_TYPE_ID},
TxEip1559, TxEip2930, TxEip4844, TxLegacy,
};
use alloy_eips::{eip1559::MIN_PROTOCOL_BASE_FEE, eip2930::AccessList, eip4844::DATA_GAS_PER_BLOB};
use alloy_eips::{
eip1559::MIN_PROTOCOL_BASE_FEE,
eip2930::AccessList,
eip4844::{BlobTransactionValidationError, DATA_GAS_PER_BLOB},
};
use alloy_primitives::{Address, Bytes, ChainId, Signature, TxHash, TxKind, B256, U256};
use paste::paste;
use rand::{
Expand All @@ -20,8 +24,8 @@ use rand::{
};
use reth_primitives::{
transaction::TryFromRecoveredTransactionError, BlobTransactionSidecar,
BlobTransactionValidationError, PooledTransactionsElementEcRecovered, Transaction,
TransactionSigned, TransactionSignedEcRecovered, TxType,
PooledTransactionsElementEcRecovered, Transaction, TransactionSigned,
TransactionSignedEcRecovered, TxType,
};

use std::{ops::Range, sync::Arc, time::Instant, vec::IntoIter};
Expand Down Expand Up @@ -761,7 +765,7 @@ impl EthPoolTransaction for MockTransaction {
&self,
_blob: &BlobTransactionSidecar,
_settings: &reth_primitives::kzg::KzgSettings,
) -> Result<(), reth_primitives::BlobTransactionValidationError> {
) -> Result<(), alloy_eips::eip4844::BlobTransactionValidationError> {
match &self {
Self::Eip4844 { .. } => Ok(()),
_ => Err(BlobTransactionValidationError::NotBlobTransaction(self.tx_type())),
Expand Down
10 changes: 7 additions & 3 deletions crates/transaction-pool/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@ use alloy_consensus::{
constants::{EIP1559_TX_TYPE_ID, EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID},
Transaction as _,
};
use alloy_eips::{eip2718::Encodable2718, eip2930::AccessList, eip4844::BlobAndProofV1};
use alloy_eips::{
eip2718::Encodable2718,
eip2930::AccessList,
eip4844::{BlobAndProofV1, BlobTransactionValidationError},
};
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, BlobTransactionSidecar,
BlobTransactionValidationError, PooledTransactionsElement,
PooledTransactionsElementEcRecovered, SealedBlock, Transaction, TransactionSignedEcRecovered,
PooledTransactionsElement, PooledTransactionsElementEcRecovered, SealedBlock, Transaction,
TransactionSignedEcRecovered,
};
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
Expand Down

0 comments on commit 15c230b

Please sign in to comment.