aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/block_processor_test.go9
-rw-r--r--core/chain_manager_test.go10
2 files changed, 10 insertions, 9 deletions
diff --git a/core/block_processor_test.go b/core/block_processor_test.go
index 35aeaa714..a031c2669 100644
--- a/core/block_processor_test.go
+++ b/core/block_processor_test.go
@@ -6,14 +6,15 @@ import (
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
+ "github.com/ethereum/go-ethereum/pow/ezp"
)
func proc() (*BlockProcessor, *ChainManager) {
db, _ := ethdb.NewMemDatabase()
var mux event.TypeMux
- chainMan := NewChainManager(db, &mux)
- return NewBlockProcessor(db, nil, chainMan, &mux), chainMan
+ chainMan := NewChainManager(db, db, &mux)
+ return NewBlockProcessor(db, ezp.New(), nil, chainMan, &mux), chainMan
}
func TestNumber(t *testing.T) {
@@ -21,13 +22,13 @@ func TestNumber(t *testing.T) {
block1 := chain.NewBlock(nil)
block1.Header().Number = big.NewInt(3)
- err := bp.ValidateBlock(block1, chain.Genesis())
+ err := bp.ValidateHeader(block1.Header(), chain.Genesis().Header())
if err != BlockNumberErr {
t.Errorf("expected block number error")
}
block1 = chain.NewBlock(nil)
- err = bp.ValidateBlock(block1, chain.Genesis())
+ err = bp.ValidateHeader(block1.Header(), chain.Genesis().Header())
if err == BlockNumberErr {
t.Errorf("didn't expect block number error")
}
diff --git a/core/chain_manager_test.go b/core/chain_manager_test.go
index b562b677d..e78c2e980 100644
--- a/core/chain_manager_test.go
+++ b/core/chain_manager_test.go
@@ -257,9 +257,9 @@ func TestChainInsertions(t *testing.T) {
}
var eventMux event.TypeMux
- chainMan := NewChainManager(db, &eventMux)
+ chainMan := NewChainManager(db, db, &eventMux)
txPool := NewTxPool(&eventMux)
- blockMan := NewBlockProcessor(db, txPool, chainMan, &eventMux)
+ blockMan := NewBlockProcessor(db, nil, txPool, chainMan, &eventMux)
chainMan.SetProcessor(blockMan)
const max = 2
@@ -303,9 +303,9 @@ func TestChainMultipleInsertions(t *testing.T) {
}
}
var eventMux event.TypeMux
- chainMan := NewChainManager(db, &eventMux)
+ chainMan := NewChainManager(db, db, &eventMux)
txPool := NewTxPool(&eventMux)
- blockMan := NewBlockProcessor(db, txPool, chainMan, &eventMux)
+ blockMan := NewBlockProcessor(db, nil, txPool, chainMan, &eventMux)
chainMan.SetProcessor(blockMan)
done := make(chan bool, max)
for i, chain := range chains {
@@ -332,7 +332,7 @@ func TestGetAncestors(t *testing.T) {
db, _ := ethdb.NewMemDatabase()
var eventMux event.TypeMux
- chainMan := NewChainManager(db, &eventMux)
+ chainMan := NewChainManager(db, db, &eventMux)
chain, err := loadChain("valid1", t)
if err != nil {
fmt.Println(err)