aboutsummaryrefslogtreecommitdiffstats
path: root/core/blockchain_test.go
diff options
context:
space:
mode:
authorzsfelfoldi <zsfelfoldi@gmail.com>2015-12-16 11:26:23 +0800
committerzsfelfoldi <zsfelfoldi@gmail.com>2016-03-10 21:57:32 +0800
commit73d21ea6afad5b2a89c1aa6e3d8aa0a0fc002c00 (patch)
tree6109fe60cfde0b20f8d1608026d9a2805278c1e9 /core/blockchain_test.go
parentbff9ceb6b88021c1ba5bc02a56ec88c275e62e76 (diff)
downloadgo-tangerine-73d21ea6afad5b2a89c1aa6e3d8aa0a0fc002c00.tar
go-tangerine-73d21ea6afad5b2a89c1aa6e3d8aa0a0fc002c00.tar.gz
go-tangerine-73d21ea6afad5b2a89c1aa6e3d8aa0a0fc002c00.tar.bz2
go-tangerine-73d21ea6afad5b2a89c1aa6e3d8aa0a0fc002c00.tar.lz
go-tangerine-73d21ea6afad5b2a89c1aa6e3d8aa0a0fc002c00.tar.xz
go-tangerine-73d21ea6afad5b2a89c1aa6e3d8aa0a0fc002c00.tar.zst
go-tangerine-73d21ea6afad5b2a89c1aa6e3d8aa0a0fc002c00.zip
core: create a header chain structure shared by core.BlockChain and light.LightChain
Diffstat (limited to 'core/blockchain_test.go')
-rw-r--r--core/blockchain_test.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/core/blockchain_test.go b/core/blockchain_test.go
index a7d3ea56e..310751cca 100644
--- a/core/blockchain_test.go
+++ b/core/blockchain_test.go
@@ -472,11 +472,16 @@ func makeBlockChainWithDiff(genesis *types.Block, d []int, seed byte) []*types.B
func chm(genesis *types.Block, db ethdb.Database) *BlockChain {
var eventMux event.TypeMux
- bc := &BlockChain{chainDb: db, genesisBlock: genesis, eventMux: &eventMux, pow: FakePow{}, rand: rand.New(rand.NewSource(0))}
- bc.headerCache, _ = lru.New(100)
+ bc := &BlockChain{
+ chainDb: db,
+ genesisBlock: genesis,
+ eventMux: &eventMux,
+ pow: FakePow{},
+ }
+ valFn := func() HeaderValidator { return bc.Validator() }
+ bc.hc, _ = NewHeaderChain(db, valFn, bc.getProcInterrupt)
bc.bodyCache, _ = lru.New(100)
bc.bodyRLPCache, _ = lru.New(100)
- bc.tdCache, _ = lru.New(100)
bc.blockCache, _ = lru.New(100)
bc.futureBlocks, _ = lru.New(100)
bc.SetValidator(bproc{})