mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: rm more optimism features (#6981)
This commit is contained in:
@ -260,14 +260,6 @@ impl<T: PoolTransaction> TransactionValidator for MockTransactionValidator<T> {
|
||||
origin: TransactionOrigin,
|
||||
transaction: Self::Transaction,
|
||||
) -> TransactionValidationOutcome<Self::Transaction> {
|
||||
#[cfg(feature = "optimism")]
|
||||
if transaction.is_deposit() {
|
||||
return TransactionValidationOutcome::Invalid(
|
||||
transaction,
|
||||
reth_primitives::InvalidTransactionError::TxTypeNotSupported.into(),
|
||||
)
|
||||
}
|
||||
|
||||
// we return `balance: U256::MAX` to simulate a valid transaction which will never go into
|
||||
// overdraft
|
||||
TransactionValidationOutcome::Valid {
|
||||
|
||||
@ -290,13 +290,14 @@ impl MockTransaction {
|
||||
/// * [MockTransaction::eip1559]
|
||||
/// * [MockTransaction::eip4844]
|
||||
pub fn new_from_type(tx_type: TxType) -> Self {
|
||||
#[allow(unreachable_patterns)]
|
||||
match tx_type {
|
||||
TxType::Legacy => Self::legacy(),
|
||||
TxType::EIP2930 => Self::eip2930(),
|
||||
TxType::EIP1559 => Self::eip1559(),
|
||||
TxType::EIP4844 => Self::eip4844(),
|
||||
#[cfg(feature = "optimism")]
|
||||
TxType::DEPOSIT => todo!(), // not handled in mock tx
|
||||
|
||||
_ => unreachable!("Invalid transaction type"),
|
||||
}
|
||||
}
|
||||
|
||||
@ -717,12 +718,6 @@ impl PoolTransaction for MockTransaction {
|
||||
fn chain_id(&self) -> Option<u64> {
|
||||
Some(1)
|
||||
}
|
||||
|
||||
/// Returns true if the transaction is a deposit transaction.
|
||||
#[cfg(feature = "optimism")]
|
||||
fn is_deposit(&self) -> bool {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
impl FromRecoveredTransaction for MockTransaction {
|
||||
@ -731,6 +726,8 @@ impl FromRecoveredTransaction for MockTransaction {
|
||||
let transaction = tx.into_signed();
|
||||
let hash = transaction.hash();
|
||||
let size = transaction.size();
|
||||
|
||||
#[allow(unreachable_patterns)]
|
||||
match transaction.transaction {
|
||||
Transaction::Legacy(TxLegacy {
|
||||
chain_id: _,
|
||||
@ -822,8 +819,7 @@ impl FromRecoveredTransaction for MockTransaction {
|
||||
accesslist: access_list,
|
||||
size,
|
||||
},
|
||||
#[cfg(feature = "optimism")]
|
||||
Transaction::Deposit(_) => todo!(), // not handled in mock tx
|
||||
_ => unreachable!("Invalid transaction type"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -848,10 +848,6 @@ pub trait PoolTransaction:
|
||||
|
||||
/// Returns chain_id
|
||||
fn chain_id(&self) -> Option<u64>;
|
||||
|
||||
/// Returns whether or not the transaction is an Optimism Deposited transaction.
|
||||
#[cfg(feature = "optimism")]
|
||||
fn is_deposit(&self) -> bool;
|
||||
}
|
||||
|
||||
/// An extension trait that provides additional interfaces for the
|
||||
@ -1089,12 +1085,6 @@ impl PoolTransaction for EthPooledTransaction {
|
||||
fn chain_id(&self) -> Option<u64> {
|
||||
self.transaction.chain_id()
|
||||
}
|
||||
|
||||
/// Returns whether or not the transaction is an Optimism Deposited transaction.
|
||||
#[cfg(feature = "optimism")]
|
||||
fn is_deposit(&self) -> bool {
|
||||
matches!(self.transaction.transaction, Transaction::Deposit(_))
|
||||
}
|
||||
}
|
||||
|
||||
impl EthPoolTransaction for EthPooledTransaction {
|
||||
|
||||
Reference in New Issue
Block a user