primitives: small refactor in gas_limit method (#10668)

This commit is contained in:
Thomas Coratger
2024-09-02 15:07:58 -07:00
committed by GitHub
parent 659375d776
commit 08719deb4e

View File

@ -309,10 +309,10 @@ impl Transaction {
/// Get the gas limit of the transaction.
pub const fn gas_limit(&self) -> u64 {
match self {
Self::Legacy(TxLegacy { gas_limit, .. }) => *gas_limit as u64,
Self::Eip1559(TxEip1559 { gas_limit, .. }) => *gas_limit as u64,
Self::Eip4844(TxEip4844 { gas_limit, .. }) => *gas_limit as u64,
Self::Eip7702(TxEip7702 { gas_limit, .. }) => *gas_limit as u64,
Self::Legacy(TxLegacy { gas_limit, .. }) |
Self::Eip1559(TxEip1559 { gas_limit, .. }) |
Self::Eip4844(TxEip4844 { gas_limit, .. }) |
Self::Eip7702(TxEip7702 { gas_limit, .. }) |
Self::Eip2930(TxEip2930 { gas_limit, .. }) => *gas_limit as u64,
#[cfg(feature = "optimism")]
Self::Deposit(TxDeposit { gas_limit, .. }) => *gas_limit,