Fix for NPE in eth_getBlockByNumber (#1841)

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
This commit is contained in:
ledgerwatch 2021-04-29 12:34:00 +01:00 committed by GitHub
parent 711f157cf5
commit 79055c760e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -844,16 +844,16 @@ func newRPCTransaction(tx types.Transaction, blockHash common.Hash, blockNumber
result.R = (*hexutil.Big)(t.R.ToBig())
result.S = (*hexutil.Big)(t.S.ToBig())
case *types.AccessListTx:
result.ChainID = (*hexutil.Big)(t.ChainID.ToBig())
chainId.SetFromBig(result.ChainID.ToInt())
chainId.Set(t.ChainID)
result.ChainID = (*hexutil.Big)(chainId.ToBig())
result.GasPrice = (*hexutil.Big)(t.GasPrice.ToBig())
result.V = (*hexutil.Big)(t.V.ToBig())
result.R = (*hexutil.Big)(t.R.ToBig())
result.S = (*hexutil.Big)(t.S.ToBig())
result.Accesses = &t.AccessList
case *types.DynamicFeeTransaction:
chainId.SetFromBig(result.ChainID.ToInt())
result.ChainID = (*hexutil.Big)(t.ChainID.ToBig())
chainId.Set(t.ChainID)
result.ChainID = (*hexutil.Big)(chainId.ToBig())
result.Tip = (*hexutil.Big)(t.Tip.ToBig())
result.FeeCap = (*hexutil.Big)(t.FeeCap.ToBig())
result.V = (*hexutil.Big)(t.V.ToBig())