chore: use existing transaction fns (#12793)

This commit is contained in:
Matthias Seitz
2024-11-22 20:14:58 +01:00
committed by GitHub
parent 55d047fcf6
commit 2d5256cb05

View File

@ -1245,15 +1245,7 @@ impl PoolTransaction for EthPooledTransaction {
///
/// This is also commonly referred to as the "Gas Fee Cap" (`GasFeeCap`).
fn max_fee_per_gas(&self) -> u128 {
#[allow(unreachable_patterns)]
match &self.transaction.transaction {
Transaction::Legacy(tx) => tx.gas_price,
Transaction::Eip2930(tx) => tx.gas_price,
Transaction::Eip1559(tx) => tx.max_fee_per_gas,
Transaction::Eip4844(tx) => tx.max_fee_per_gas,
Transaction::Eip7702(tx) => tx.max_fee_per_gas,
_ => 0,
}
self.transaction.transaction.max_fee_per_gas()
}
fn access_list(&self) -> Option<&AccessList> {
@ -1264,14 +1256,7 @@ impl PoolTransaction for EthPooledTransaction {
///
/// This will return `None` for non-EIP1559 transactions
fn max_priority_fee_per_gas(&self) -> Option<u128> {
#[allow(unreachable_patterns, clippy::match_same_arms)]
match &self.transaction.transaction {
Transaction::Legacy(_) | Transaction::Eip2930(_) => None,
Transaction::Eip1559(tx) => Some(tx.max_priority_fee_per_gas),
Transaction::Eip4844(tx) => Some(tx.max_priority_fee_per_gas),
Transaction::Eip7702(tx) => Some(tx.max_priority_fee_per_gas),
_ => None,
}
self.transaction.transaction.max_priority_fee_per_gas()
}
fn max_fee_per_blob_gas(&self) -> Option<u128> {