From bbdd7efcffec4100d0b2b9fc6eaa893be174f911 Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Wed, 22 Dec 2021 12:14:14 +0100 Subject: [PATCH] More cleanup --- ethstats/ethstats.go | 10 ++++------ internal/ethapi/backend.go | 1 - 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/ethstats/ethstats.go b/ethstats/ethstats.go index c1a5e9cac0..e699846b76 100644 --- a/ethstats/ethstats.go +++ b/ethstats/ethstats.go @@ -71,17 +71,15 @@ type backend interface { GetTd(ctx context.Context, hash common.Hash) *big.Int Stats() (pending int, queued int) SyncProgress() ethereum.SyncProgress -} -type extendedBackend interface { - backend + // Bor SubscribeChain2HeadEvent(ch chan<- core.Chain2HeadEvent) event.Subscription } // fullNodeBackend encompasses the functionality necessary for a full node // reporting to ethstats type fullNodeBackend interface { - extendedBackend + backend Miner() *miner.Miner BlockByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Block, error) CurrentBlock() *types.Block @@ -92,7 +90,7 @@ type fullNodeBackend interface { // chain statistics up to a monitoring server. type Service struct { server *p2p.Server // Peer-to-peer server to retrieve networking infos - backend extendedBackend + backend backend engine consensus.Engine // Consensus engine to retrieve variadic block fields node string // Name of the node to display on the monitoring page @@ -179,7 +177,7 @@ func parseEthstatsURL(url string) (parts []string, err error) { } // New returns a monitoring service ready for stats reporting. -func New(node *node.Node, backend extendedBackend, engine consensus.Engine, url string) error { +func New(node *node.Node, backend backend, engine consensus.Engine, url string) error { parts, err := parseEthstatsURL(url) if err != nil { return err diff --git a/internal/ethapi/backend.go b/internal/ethapi/backend.go index b0b3c88a8b..97ce7c24cf 100644 --- a/internal/ethapi/backend.go +++ b/internal/ethapi/backend.go @@ -98,7 +98,6 @@ type Backend interface { GetBorBlockLogs(ctx context.Context, hash common.Hash) ([]*types.Log, error) GetBorBlockTransaction(ctx context.Context, txHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error) GetBorBlockTransactionWithBlockHash(ctx context.Context, txHash common.Hash, blockHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error) - SubscribeChain2HeadEvent(ch chan<- core.Chain2HeadEvent) event.Subscription ChainConfig() *params.ChainConfig