Skip to content

Commit

Permalink
primitives: small refactor in gas_limit method (#10668)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger committed Sep 2, 2024
1 parent 659375d commit 08719de
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/primitives/src/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 08719de

Please sign in to comment.