diff --git a/core/block_processor_test.go b/core/block_processor_test.go index 35aeaa714a..a031c26698 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 b562b677d2..e78c2e980e 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) diff --git a/eth/protocol_test.go b/eth/protocol_test.go index c4e3e9f1b3..c118e6aae3 100644 --- a/eth/protocol_test.go +++ b/eth/protocol_test.go @@ -9,6 +9,7 @@ import ( "testing" "time" + ethlogger "github.com/ethereum/go-ethereu/logger" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/errs"