core: flush out trie cache more meaningfully on stop (#16143)

* core: flush out trie cache more meaningfully on stop

* core: upgrade legacy tests to chain maker
This commit is contained in:
Péter Szilágyi
2018-02-23 14:02:33 +02:00
committed by GitHub
parent fb5d085234
commit 89f914c030
3 changed files with 123 additions and 128 deletions

View File

@ -118,10 +118,12 @@ func TestSetupGenesis(t *testing.T) {
// Commit the 'old' genesis block with Homestead transition at #2.
// Advance to block #4, past the homestead transition block of customg.
genesis := oldcustomg.MustCommit(db)
bc, _ := NewBlockChain(db, nil, oldcustomg.Config, ethash.NewFullFaker(), vm.Config{})
defer bc.Stop()
bc.SetValidator(bproc{})
bc.InsertChain(makeBlockChainWithDiff(genesis, []int{2, 3, 4, 5}, 0))
blocks, _ := GenerateChain(oldcustomg.Config, genesis, ethash.NewFaker(), db, 4, nil)
bc.InsertChain(blocks)
bc.CurrentBlock()
// This should return a compatibility error.
return SetupGenesisBlock(db, &customg)