aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/block_chain_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'ethchain/block_chain_test.go')
-rw-r--r--ethchain/block_chain_test.go23
1 files changed, 17 insertions, 6 deletions
diff --git a/ethchain/block_chain_test.go b/ethchain/block_chain_test.go
index bbc96c823..1edcf9c7b 100644
--- a/ethchain/block_chain_test.go
+++ b/ethchain/block_chain_test.go
@@ -3,16 +3,19 @@ package ethchain
import (
"container/list"
"fmt"
+ "testing"
+
+ "github.com/ethereum/eth-go/ethcrypto"
"github.com/ethereum/eth-go/ethdb"
+ "github.com/ethereum/eth-go/ethreact"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethwire"
- "testing"
)
// Implement our EthTest Manager
type TestManager struct {
stateManager *StateManager
- reactor *ethutil.ReactorEngine
+ reactor *ethreact.ReactorEngine
txPool *TxPool
blockChain *BlockChain
@@ -47,16 +50,24 @@ func (tm *TestManager) StateManager() *StateManager {
return tm.stateManager
}
-func (tm *TestManager) Reactor() *ethutil.ReactorEngine {
+func (tm *TestManager) Reactor() *ethreact.ReactorEngine {
return tm.reactor
}
func (tm *TestManager) Broadcast(msgType ethwire.MsgType, data []interface{}) {
fmt.Println("Broadcast not implemented")
}
-func NewTestManager() *TestManager {
+func (tm *TestManager) ClientIdentity() ethwire.ClientIdentity {
+ return nil
+}
+func (tm *TestManager) KeyManager() *ethcrypto.KeyManager {
+ return nil
+}
- ethutil.ReadConfig(".ethtest", "/tmp/ethtest", "", "ETH")
+func (tm *TestManager) Db() ethutil.Database { return nil }
+
+func NewTestManager() *TestManager {
+ ethutil.ReadConfig(".ethtest", "/tmp/ethtest", "ETH")
db, err := ethdb.NewMemDatabase()
if err != nil {
@@ -66,7 +77,7 @@ func NewTestManager() *TestManager {
ethutil.Config.Db = db
testManager := &TestManager{}
- testManager.reactor = ethutil.NewReactorEngine()
+ testManager.reactor = ethreact.New()
testManager.txPool = NewTxPool(testManager)
testManager.blockChain = NewBlockChain(testManager)