diff --git a/eth/gasprice/feehistory.go b/eth/gasprice/feehistory.go index f674a5666..dc692d8b7 100644 --- a/eth/gasprice/feehistory.go +++ b/eth/gasprice/feehistory.go @@ -120,8 +120,7 @@ func (oracle *Oracle) processBlock(bf *blockFees, percentiles []float64) { } sorter := make(sortGasAndReward, len(bf.block.Transactions())) for i, tx := range bf.block.Transactions() { - reward := big.NewInt(0) - reward, _ = tx.EffectiveGasTip(bf.block.BaseFee()) + reward, _ := tx.EffectiveGasTip(bf.block.BaseFee()) sorter[i] = txGasAndReward{gasUsed: bf.receipts[i].GasUsed, reward: reward} } sort.Sort(sorter) diff --git a/graphql/graphql.go b/graphql/graphql.go index 8c4cbbc3f..64890619d 100644 --- a/graphql/graphql.go +++ b/graphql/graphql.go @@ -246,8 +246,6 @@ func (t *Transaction) GasPrice(ctx context.Context) (hexutil.Big, error) { case types.AltFeeTxType: if t.block != nil { if baseFee, _ := t.block.BaseFeePerGas(ctx); baseFee != nil { - // TODO base fee of erc20 fee - // price = min(tip, gasFeeCap - baseFee) + baseFee return (hexutil.Big)(*math.BigMin(new(big.Int).Add(tx.GasTipCap(), baseFee.ToInt()), tx.GasFeeCap())), nil } }