internal/ethapi: default effectiveGasPrice when nil

This commit is contained in:
marcello33 2023-09-11 07:46:45 +02:00
parent 19826950a8
commit fca0d89227

View file

@ -2105,6 +2105,10 @@ func (s *TransactionAPI) GetTransactionReceipt(ctx context.Context, hash common.
"effectiveGasPrice": (*hexutil.Big)(receipt.EffectiveGasPrice),
}
if receipt.EffectiveGasPrice == nil {
fields["effectiveGasPrice"] = new(hexutil.Big)
}
// Assign receipt status or post state.
if len(receipt.PostState) > 0 {
fields["root"] = hexutil.Bytes(receipt.PostState)