core/state/snapshot, tests: sync snap gen + snaps in consensus tests

This commit is contained in:
Péter Szilágyi
2020-03-03 09:10:23 +02:00
parent fe8347ea8a
commit 6e05ccd845
14 changed files with 90 additions and 36 deletions

View File

@ -94,7 +94,7 @@ type btHeaderMarshaling struct {
Timestamp math.HexOrDecimal64
}
func (t *BlockTest) Run() error {
func (t *BlockTest) Run(snapshotter bool) error {
config, ok := Forks[t.json.Network]
if !ok {
return UnsupportedForkError{t.json.Network}
@ -118,7 +118,12 @@ func (t *BlockTest) Run() error {
} else {
engine = ethash.NewShared()
}
chain, err := core.NewBlockChain(db, &core.CacheConfig{TrieCleanLimit: 0}, config, engine, vm.Config{}, nil)
cache := &core.CacheConfig{TrieCleanLimit: 0}
if snapshotter {
cache.SnapshotLimit = 1
cache.SnapshotWait = true
}
chain, err := core.NewBlockChain(db, cache, config, engine, vm.Config{}, nil)
if err != nil {
return err
}