Skip to content

Commit e349fac

Browse files
committed
core: fixed tests
1 parent aba901e commit e349fac

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

core/chain_makers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func ExampleGenerateChain() {
6060
evmux := &event.TypeMux{}
6161
chainman, _ := NewChainManager(genesis, db, db, FakePow{}, evmux)
6262
chainman.SetProcessor(NewBlockProcessor(db, db, FakePow{}, chainman, evmux))
63-
if i, err := chainman.InsertChain(chain[1:]); err != nil {
63+
if i, err := chainman.InsertChain(chain); err != nil {
6464
fmt.Printf("insert error (block %d): %v\n", i, err)
6565
return
6666
}

core/chain_manager.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ func (bc *ChainManager) setLastState() {
264264
func (bc *ChainManager) makeCache() {
265265
bc.cache, _ = lru.New(blockCacheLimit)
266266
// load in last `blockCacheLimit` - 1 blocks. Last block is the current.
267+
bc.cache.Add(bc.genesisBlock.Hash(), bc.genesisBlock)
267268
for _, block := range bc.GetBlocksFromHash(bc.currentBlock.Hash(), blockCacheLimit) {
268269
bc.cache.Add(block.Hash(), block)
269270
}

core/chain_manager_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ func testFork(t *testing.T, bman *BlockProcessor, i, N int, f func(td1, td2 *big
6363
if bi1 != bi2 {
6464
t.Fatal("chains do not have the same hash at height", i)
6565
}
66-
6766
bman2.bc.SetProcessor(bman2)
6867

6968
// extend the fork

0 commit comments

Comments
 (0)