core/state/snapshot, tests: sync snap gen + snaps in consensus tests
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user