aboutsummaryrefslogtreecommitdiffstats
path: root/dex
diff options
context:
space:
mode:
authorSonic <sonic@dexon.org>2018-11-09 14:49:23 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-12 17:27:18 +0800
commit5aaccf466773e60c93ab150d89abd950bd43ca28 (patch)
tree2790899da83803dfad804c77209c312704e72a60 /dex
parent4e158ea3b851e3886f5682a78c69ce06e3690865 (diff)
downloadgo-tangerine-5aaccf466773e60c93ab150d89abd950bd43ca28.tar
go-tangerine-5aaccf466773e60c93ab150d89abd950bd43ca28.tar.gz
go-tangerine-5aaccf466773e60c93ab150d89abd950bd43ca28.tar.bz2
go-tangerine-5aaccf466773e60c93ab150d89abd950bd43ca28.tar.lz
go-tangerine-5aaccf466773e60c93ab150d89abd950bd43ca28.tar.xz
go-tangerine-5aaccf466773e60c93ab150d89abd950bd43ca28.tar.zst
go-tangerine-5aaccf466773e60c93ab150d89abd950bd43ca28.zip
dex: use dex/downloader in dex
To compatible with ethereum code base, make Downloader a interface in internal/ethapi
Diffstat (limited to 'dex')
-rw-r--r--dex/api_backend.go4
-rw-r--r--dex/backend.go20
-rw-r--r--dex/config.go2
-rw-r--r--dex/handler.go4
-rw-r--r--dex/handler_test.go2
-rw-r--r--dex/helper_test.go2
-rw-r--r--dex/protocol_test.go2
-rw-r--r--dex/sync.go2
8 files changed, 19 insertions, 19 deletions
diff --git a/dex/api_backend.go b/dex/api_backend.go
index c6c1d214d..9929b062d 100644
--- a/dex/api_backend.go
+++ b/dex/api_backend.go
@@ -29,8 +29,8 @@ import (
"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/eth/gasprice"
+ "github.com/dexon-foundation/dexon/internal/ethapi"
"github.com/dexon-foundation/dexon/ethdb"
"github.com/dexon-foundation/dexon/event"
@@ -186,7 +186,7 @@ func (b *DexAPIBackend) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) event.S
return b.dex.TxPool().SubscribeNewTxsEvent(ch)
}
-func (b *DexAPIBackend) Downloader() *downloader.Downloader {
+func (b *DexAPIBackend) Downloader() ethapi.Downloader {
return b.dex.Downloader()
}
diff --git a/dex/backend.go b/dex/backend.go
index 36b28345c..8fe9e9ea3 100644
--- a/dex/backend.go
+++ b/dex/backend.go
@@ -33,7 +33,7 @@ import (
"github.com/dexon-foundation/dexon/core/rawdb"
"github.com/dexon-foundation/dexon/core/vm"
"github.com/dexon-foundation/dexon/dex/blockdb"
- "github.com/dexon-foundation/dexon/eth/downloader"
+ "github.com/dexon-foundation/dexon/dex/downloader"
"github.com/dexon-foundation/dexon/eth/filters"
"github.com/dexon-foundation/dexon/eth/gasprice"
"github.com/dexon-foundation/dexon/ethdb"
@@ -266,12 +266,12 @@ func CreateDB(ctx *node.ServiceContext, config *Config, name string) (ethdb.Data
return db, nil
}
-func (d *Dexon) AccountManager() *accounts.Manager { return d.accountManager }
-func (d *Dexon) BlockChain() *core.BlockChain { return d.blockchain }
-func (d *Dexon) TxPool() *core.TxPool { return d.txPool }
-func (d *Dexon) DexVersion() int { return int(d.protocolManager.SubProtocols[0].Version) }
-func (d *Dexon) EventMux() *event.TypeMux { return d.eventMux }
-func (d *Dexon) Engine() consensus.Engine { return d.engine }
-func (d *Dexon) ChainDb() ethdb.Database { return d.chainDb }
-func (d *Dexon) Downloader() *downloader.Downloader { return d.protocolManager.downloader }
-func (d *Dexon) NetVersion() uint64 { return d.networkID }
+func (d *Dexon) AccountManager() *accounts.Manager { return d.accountManager }
+func (d *Dexon) BlockChain() *core.BlockChain { return d.blockchain }
+func (d *Dexon) TxPool() *core.TxPool { return d.txPool }
+func (d *Dexon) DexVersion() int { return int(d.protocolManager.SubProtocols[0].Version) }
+func (d *Dexon) EventMux() *event.TypeMux { return d.eventMux }
+func (d *Dexon) Engine() consensus.Engine { return d.engine }
+func (d *Dexon) ChainDb() ethdb.Database { return d.chainDb }
+func (d *Dexon) Downloader() ethapi.Downloader { return d.protocolManager.downloader }
+func (d *Dexon) NetVersion() uint64 { return d.networkID }
diff --git a/dex/config.go b/dex/config.go
index b90a344c8..b6ce76992 100644
--- a/dex/config.go
+++ b/dex/config.go
@@ -26,7 +26,7 @@ import (
"time"
"github.com/dexon-foundation/dexon/core"
- "github.com/dexon-foundation/dexon/eth/downloader"
+ "github.com/dexon-foundation/dexon/dex/downloader"
"github.com/dexon-foundation/dexon/eth/gasprice"
"github.com/dexon-foundation/dexon/params"
)
diff --git a/dex/handler.go b/dex/handler.go
index a1a158560..d66403fe6 100644
--- a/dex/handler.go
+++ b/dex/handler.go
@@ -54,8 +54,8 @@ import (
"github.com/dexon-foundation/dexon/core"
"github.com/dexon-foundation/dexon/core/types"
"github.com/dexon-foundation/dexon/crypto"
- "github.com/dexon-foundation/dexon/eth/downloader"
- "github.com/dexon-foundation/dexon/eth/fetcher"
+ "github.com/dexon-foundation/dexon/dex/downloader"
+ "github.com/dexon-foundation/dexon/dex/fetcher"
"github.com/dexon-foundation/dexon/ethdb"
"github.com/dexon-foundation/dexon/event"
"github.com/dexon-foundation/dexon/log"
diff --git a/dex/handler_test.go b/dex/handler_test.go
index 981362bb5..dc1ea1d73 100644
--- a/dex/handler_test.go
+++ b/dex/handler_test.go
@@ -27,7 +27,7 @@ import (
"github.com/dexon-foundation/dexon/core/state"
"github.com/dexon-foundation/dexon/core/types"
"github.com/dexon-foundation/dexon/crypto"
- "github.com/dexon-foundation/dexon/eth/downloader"
+ "github.com/dexon-foundation/dexon/dex/downloader"
"github.com/dexon-foundation/dexon/ethdb"
"github.com/dexon-foundation/dexon/p2p"
"github.com/dexon-foundation/dexon/params"
diff --git a/dex/helper_test.go b/dex/helper_test.go
index 9a135d3e3..f57f3eff4 100644
--- a/dex/helper_test.go
+++ b/dex/helper_test.go
@@ -33,7 +33,7 @@ import (
"github.com/dexon-foundation/dexon/core/types"
"github.com/dexon-foundation/dexon/core/vm"
"github.com/dexon-foundation/dexon/crypto"
- "github.com/dexon-foundation/dexon/eth/downloader"
+ "github.com/dexon-foundation/dexon/dex/downloader"
"github.com/dexon-foundation/dexon/ethdb"
"github.com/dexon-foundation/dexon/event"
"github.com/dexon-foundation/dexon/p2p"
diff --git a/dex/protocol_test.go b/dex/protocol_test.go
index b0e89230a..64d7fa3e7 100644
--- a/dex/protocol_test.go
+++ b/dex/protocol_test.go
@@ -34,7 +34,7 @@ import (
"github.com/dexon-foundation/dexon/common"
"github.com/dexon-foundation/dexon/core/types"
"github.com/dexon-foundation/dexon/crypto"
- "github.com/dexon-foundation/dexon/eth/downloader"
+ "github.com/dexon-foundation/dexon/dex/downloader"
"github.com/dexon-foundation/dexon/p2p"
"github.com/dexon-foundation/dexon/rlp"
)
diff --git a/dex/sync.go b/dex/sync.go
index 5af6076bc..b6a8035d4 100644
--- a/dex/sync.go
+++ b/dex/sync.go
@@ -23,7 +23,7 @@ import (
"github.com/dexon-foundation/dexon/common"
"github.com/dexon-foundation/dexon/core/types"
- "github.com/dexon-foundation/dexon/eth/downloader"
+ "github.com/dexon-foundation/dexon/dex/downloader"
"github.com/dexon-foundation/dexon/log"
"github.com/dexon-foundation/dexon/p2p/enode"
)