mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-23 04:03:49 +00:00
Fix eth_feeHistory (#4168)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
This commit is contained in:
parent
d845eb2a69
commit
a2a494a3d1
@ -2,7 +2,6 @@ package commands
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/ledgerwatch/erigon-lib/kv"
|
||||
"github.com/ledgerwatch/erigon/common"
|
||||
@ -199,16 +198,11 @@ func NewGasPriceOracleBackend(tx kv.Tx, cc *params.ChainConfig, baseApi *BaseAPI
|
||||
}
|
||||
|
||||
func (b *GasPriceOracleBackend) HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Header, error) {
|
||||
blockNum, err := getBlockNumber(number, b.tx)
|
||||
block, err := b.baseApi.blockByRPCNumber(number, b.tx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
header := rawdb.ReadHeaderByNumber(b.tx, blockNum)
|
||||
if header == nil {
|
||||
return nil, fmt.Errorf("header not found: %d", blockNum)
|
||||
}
|
||||
return header, nil
|
||||
return block.Header(), nil
|
||||
}
|
||||
func (b *GasPriceOracleBackend) BlockByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Block, error) {
|
||||
return b.baseApi.blockByRPCNumber(number, b.tx)
|
||||
|
Loading…
Reference in New Issue
Block a user