Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
add effectiveGasPrice to tx receipt
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Dec 9, 2021
1 parent 3f4c3a8 commit 888bb67
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rpc/ethereum/namespaces/eth/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,14 @@ func (e *PublicAPI) GetTransactionReceipt(hash common.Hash) (map[string]interfac
receipt["contractAddress"] = crypto.CreateAddress(from, txData.GetNonce())
}

if dynamicTx, ok := txData.(*evmtypes.DynamicFeeTx); ok {
baseFee, err := e.backend.BaseFee(res.Height)
if err != nil {
return nil, err
}
receipt["effectiveGasPrice"] = hexutil.Big(*dynamicTx.GetEffectiveGasPrice(baseFee))
}

return receipt, nil
}

Expand Down

0 comments on commit 888bb67

Please sign in to comment.