les: duplicate downloader and fetcher to allow progressive refactoring
This commit is contained in:
@ -122,7 +122,7 @@ func (s *PublicEthereumAPI) FeeHistory(ctx context.Context, blockCount rpc.Decim
|
||||
// - pulledStates: number of state entries processed until now
|
||||
// - knownStates: number of known state entries that still need to be pulled
|
||||
func (s *PublicEthereumAPI) Syncing() (interface{}, error) {
|
||||
progress := s.b.Downloader().Progress()
|
||||
progress := s.b.SyncProgress()
|
||||
|
||||
// Return not syncing if the synchronisation already completed
|
||||
if progress.CurrentBlock >= progress.HighestBlock {
|
||||
|
@ -21,6 +21,7 @@ import (
|
||||
"context"
|
||||
"math/big"
|
||||
|
||||
"github.com/ethereum/go-ethereum"
|
||||
"github.com/ethereum/go-ethereum/accounts"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/consensus"
|
||||
@ -29,7 +30,6 @@ import (
|
||||
"github.com/ethereum/go-ethereum/core/state"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/core/vm"
|
||||
"github.com/ethereum/go-ethereum/eth/downloader"
|
||||
"github.com/ethereum/go-ethereum/ethdb"
|
||||
"github.com/ethereum/go-ethereum/event"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
@ -40,7 +40,8 @@ import (
|
||||
// both full and light clients) with access to necessary functions.
|
||||
type Backend interface {
|
||||
// General Ethereum API
|
||||
Downloader() *downloader.Downloader
|
||||
SyncProgress() ethereum.SyncProgress
|
||||
|
||||
SuggestGasTipCap(ctx context.Context) (*big.Int, error)
|
||||
FeeHistory(ctx context.Context, blockCount int, lastBlock rpc.BlockNumber, rewardPercentiles []float64) (*big.Int, [][]*big.Int, []*big.Int, []float64, error)
|
||||
ChainDb() ethdb.Database
|
||||
|
Reference in New Issue
Block a user