Commit cfb2b51b authored by obscuren's avatar obscuren

eth/downloader: fixed test

parent f6669db0
...@@ -81,7 +81,7 @@ func testChain(chainB types.Blocks, bman *BlockProcessor) (*big.Int, error) { ...@@ -81,7 +81,7 @@ func testChain(chainB types.Blocks, bman *BlockProcessor) (*big.Int, error) {
return nil, err return nil, err
} }
parent := bman.bc.GetBlock(block.ParentHash()) parent := bman.bc.GetBlock(block.ParentHash())
block.Td = CalculateTD(block, parent) block.Td = CalcTD(block, parent)
td = block.Td td = block.Td
bman.bc.mu.Lock() bman.bc.mu.Lock()
......
...@@ -8,6 +8,7 @@ import ( ...@@ -8,6 +8,7 @@ import (
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/event"
) )
var ( var (
...@@ -67,7 +68,8 @@ func newTester(t *testing.T, hashes []common.Hash, blocks map[common.Hash]*types ...@@ -67,7 +68,8 @@ func newTester(t *testing.T, hashes []common.Hash, blocks map[common.Hash]*types
done: make(chan bool), done: make(chan bool),
} }
downloader := New(tester.hasBlock, tester.getBlock) var mux event.TypeMux
downloader := New(&mux, tester.hasBlock, tester.getBlock)
tester.downloader = downloader tester.downloader = downloader
return tester return tester
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment