@@ -808,7 +808,7 @@ func (api *APIImpl) GetERCBlockReceipts(ctx context.Context, to rpc.BlockNumber,
808
808
blocks := make ([]map [string ]interface {}, 0 )
809
809
for ; start <= end ; start ++ {
810
810
var (
811
- totalFees uint64
811
+ totalFees = big . NewInt ( 0 )
812
812
)
813
813
814
814
blockNum , hash , _ , err := rpchelper .GetBlockNumber (rpc .BlockNumberOrHashWithNumber (rpc .BlockNumber (start )), tx , api .filters )
@@ -842,15 +842,16 @@ func (api *APIImpl) GetERCBlockReceipts(ctx context.Context, to rpc.BlockNumber,
842
842
843
843
// Gas Fee Calculation
844
844
txn := block .Transactions ()[receipt .TransactionIndex ]
845
- effectiveGasPrice := uint64 ( 0 )
845
+ var effectiveGasPrice * big. Int
846
846
if ! chainConfig .IsLondon (block .NumberU64 ()) {
847
- effectiveGasPrice = txn .GetPrice ().Uint64 ()
847
+ effectiveGasPrice = txn .GetPrice ().ToBig ()
848
848
} else {
849
849
baseFee , _ := uint256 .FromBig (block .BaseFee ())
850
850
gasPrice := new (big.Int ).Add (block .BaseFee (), txn .GetEffectiveGasTip (baseFee ).ToBig ())
851
- effectiveGasPrice = gasPrice . Uint64 ()
851
+ effectiveGasPrice = gasPrice
852
852
}
853
- totalFees += effectiveGasPrice * receipt .GasUsed
853
+ fee := new (big.Int ).Mul (effectiveGasPrice , new (big.Int ).SetUint64 (receipt .GasUsed ))
854
+ totalFees = new (big.Int ).Add (totalFees , fee )
854
855
}
855
856
856
857
if chainConfig .Bor != nil {
@@ -875,7 +876,7 @@ func (api *APIImpl) GetERCBlockReceipts(ctx context.Context, to rpc.BlockNumber,
875
876
"gasUsed" : hexutil .Uint64 (block .GasUsed ()),
876
877
"miner" : block .Coinbase (),
877
878
"issuance" : issuance .Issuance ,
878
- "totalFees" : hexutil .Uint64 (totalFees ),
879
+ "totalFees" : hexutil .EncodeBig (totalFees ),
879
880
"transactions" : result ,
880
881
})
881
882
}
0 commit comments