graphql: fix GasPrice for blob and setcode transactions

This commit is contained in:
m6xwzzz 2026-01-07 10:03:41 +08:00
parent eaaa5b716d
commit c82abec004

View file

@ -272,7 +272,7 @@ func (t *Transaction) GasPrice(ctx context.Context) hexutil.Big {
return hexutil.Big{} return hexutil.Big{}
} }
switch tx.Type() { switch tx.Type() {
case types.DynamicFeeTxType: case types.DynamicFeeTxType, types.BlobTxType, types.SetCodeTxType:
if block != nil { if block != nil {
if baseFee, _ := block.BaseFeePerGas(ctx); baseFee != nil { if baseFee, _ := block.BaseFeePerGas(ctx); baseFee != nil {
// price = min(gasTipCap + baseFee, gasFeeCap) // price = min(gasTipCap + baseFee, gasFeeCap)