aboutsummaryrefslogtreecommitdiffstats
path: root/dex
diff options
context:
space:
mode:
authorSonic <sonic@dexon.org>2018-11-09 14:49:23 +0800
committerWei-Ning Huang <w@dexon.org>2019-03-12 12:19:09 +0800
commite508bf0a8074e803cbcdaa162fd3289de2afda94 (patch)
treeac10c3cced1f817d12bd2e4c0c9e50d8a1d7e3bd /dex
parent202b8a467827118e1243b98dbd8111c3d806211e (diff)
downloaddexon-e508bf0a8074e803cbcdaa162fd3289de2afda94.tar.gz
dexon-e508bf0a8074e803cbcdaa162fd3289de2afda94.tar.zst
dexon-e508bf0a8074e803cbcdaa162fd3289de2afda94.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 14969fd2a..0c8dfdb8a 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 438e959e3..4505ff59c 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"
)