Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/types/receipt.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ func (r *Receipt) DeriveFields(signer Signer, context DeriveReceiptContext) {
r.GasUsed = context.GasUsed
}
if context.CollectTips {
r.EffectiveGasPrice = context.Tx.inner.effectiveGasPrice(new(big.Int), context.BaseFee)
r.EffectiveGasPrice = context.Tx.EffectiveGasPrice(context.BaseFee)
} else {
r.EffectiveGasPrice = context.BaseFee
}
Expand Down
5 changes: 5 additions & 0 deletions core/types/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,11 @@ func (tx *Transaction) GasTipCapIntCmp(other *big.Int) int {
return tx.inner.gasTipCap().Cmp(other)
}

// EffectiveGasPrice returns the gas price paid by the transaction for the given base fee.
func (tx *Transaction) EffectiveGasPrice(baseFee *big.Int) *big.Int {
return tx.inner.effectiveGasPrice(new(big.Int), baseFee)
}

// EffectiveGasTip returns the effective miner gasTipCap for the given base fee.
// Note: if the effective gasTipCap would be negative, this method
// returns ErrGasFeeCapTooLow, and value is undefined.
Expand Down
Loading