From 5aaccf466773e60c93ab150d89abd950bd43ca28 Mon Sep 17 00:00:00 2001 From: Sonic Date: Fri, 9 Nov 2018 14:49:23 +0800 Subject: dex: use dex/downloader in dex To compatible with ethereum code base, make Downloader a interface in internal/ethapi --- internal/ethapi/backend.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'internal') diff --git a/internal/ethapi/backend.go b/internal/ethapi/backend.go index 2b4e6f0fc..801b55d5c 100644 --- a/internal/ethapi/backend.go +++ b/internal/ethapi/backend.go @@ -21,24 +21,28 @@ import ( "context" "math/big" + ethereum "github.com/dexon-foundation/dexon" "github.com/dexon-foundation/dexon/accounts" "github.com/dexon-foundation/dexon/common" "github.com/dexon-foundation/dexon/core" "github.com/dexon-foundation/dexon/core/state" "github.com/dexon-foundation/dexon/core/types" "github.com/dexon-foundation/dexon/core/vm" - "github.com/dexon-foundation/dexon/eth/downloader" "github.com/dexon-foundation/dexon/ethdb" "github.com/dexon-foundation/dexon/event" "github.com/dexon-foundation/dexon/params" "github.com/dexon-foundation/dexon/rpc" ) +type Downloader interface { + Progress() ethereum.SyncProgress +} + // Backend interface provides the common API services (that are provided by // both full and light clients) with access to necessary functions. type Backend interface { // General Ethereum API - Downloader() *downloader.Downloader + Downloader() Downloader ProtocolVersion() int SuggestPrice(ctx context.Context) (*big.Int, error) ChainDb() ethdb.Database -- cgit v1.2.3