Skip to content

Commit b5a83aa

Browse files
committed
eth, internal/ethapi: fix lint
(cherry picked from commit c867cce) # Conflicts: # eth/api.go # internal/ethapi/api.go
1 parent 0cc4980 commit b5a83aa

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

eth/api_debug.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ func (api *DebugAPI) GetAccessibleState(from, to rpc.BlockNumber) (uint64, error
436436
func (api *DebugAPI) GetBlockReceipts(blockHash common.Hash) ([]map[string]interface{}, error) {
437437
if receipts := api.eth.blockchain.GetReceiptsByHash(blockHash); receipts != nil {
438438
if block := api.eth.blockchain.GetBlockByHash(blockHash); block != nil {
439-
return ethapi.ToTxReceipts(block.Header().Number.Uint64(), blockHash, receipts, block)
439+
return ethapi.ToTxReceipts(api.eth.APIBackend.ChainConfig(), block.Header().Number.Uint64(), blockHash, receipts, block)
440440
}
441441
}
442442
return nil, errors.New("unknown receipts")

internal/ethapi/api.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2013,11 +2013,10 @@ func (s *TransactionAPI) GetTransactionReceiptsByBlockNumber(ctx context.Context
20132013
return nil, fmt.Errorf("block %d not found", blockNumber)
20142014
}
20152015

2016-
return ToTxReceipts(blockNumber, blockHash, receipts, block)
2016+
return ToTxReceipts(s.b.ChainConfig(), blockNumber, blockHash, receipts, block)
20172017
}
20182018

2019-
func ToTxReceipts(blockNumber uint64, blockHash common.Hash, receipts types.Receipts, block *types.Block) ([]map[string]interface{}, error) {
2020-
2019+
func ToTxReceipts(config *params.ChainConfig, blockNumber uint64, blockHash common.Hash, receipts types.Receipts, block *types.Block) ([]map[string]interface{}, error) {
20212020
txs := block.Transactions()
20222021
if len(txs) != len(receipts) {
20232022
return nil, fmt.Errorf("txs length doesn't equal to receipts' length")
@@ -2026,7 +2025,7 @@ func ToTxReceipts(blockNumber uint64, blockHash common.Hash, receipts types.Rece
20262025
txReceipts := make([]map[string]interface{}, 0, len(txs))
20272026
for idx, receipt := range receipts {
20282027
tx := txs[idx]
2029-
signer := types.MakeSigner(s.b.ChainConfig(), block.Number(), block.Time())
2028+
signer := types.MakeSigner(config, block.Number(), block.Time())
20302029
from, _ := types.Sender(signer, tx)
20312030

20322031
fields := map[string]interface{}{

0 commit comments

Comments
 (0)