From 79055c760ed239f8c5cc37425d2434b8d013799a Mon Sep 17 00:00:00 2001 From: ledgerwatch Date: Thu, 29 Apr 2021 12:34:00 +0100 Subject: [PATCH] Fix for NPE in eth_getBlockByNumber (#1841) Co-authored-by: Alex Sharp --- internal/ethapi/api.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index b1837f2e7..f0b652776 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -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())