Skip to content

Commit

Permalink
refactor: remove subtraction from effective gas price
Browse files Browse the repository at this point in the history
  • Loading branch information
Wodann committed Apr 12, 2024
1 parent 03796a3 commit 54a8716
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions crates/edr_eth/src/transaction/signed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,12 @@ impl SignedTransaction {
SignedTransaction::PreEip155Legacy(tx) => tx.gas_price,
SignedTransaction::PostEip155Legacy(tx) => tx.gas_price,
SignedTransaction::Eip2930(tx) => tx.gas_price,
SignedTransaction::Eip1559(tx) => {
block_base_fee
+ (tx.max_fee_per_gas - block_base_fee).min(tx.max_priority_fee_per_gas)
}
SignedTransaction::Eip4844(tx) => {
block_base_fee
+ (tx.max_fee_per_gas - block_base_fee).min(tx.max_priority_fee_per_gas)
}
SignedTransaction::Eip1559(tx) => tx
.max_fee_per_gas
.min(block_base_fee + tx.max_priority_fee_per_gas),
SignedTransaction::Eip4844(tx) => tx
.max_fee_per_gas
.min(block_base_fee + tx.max_priority_fee_per_gas),
}
}

Expand Down

0 comments on commit 54a8716

Please sign in to comment.