core/state: random enable fast/slow deletion

This commit is contained in:
Gary Rong 2023-08-22 14:54:25 +08:00
parent 297a3bd697
commit e923d89d52

View file

@ -188,19 +188,21 @@ func (test *stateTest) run() bool {
defer disk.Close()
defer tdb.Close()
snap, _ := snapshot.New(snapshot.Config{
CacheSize: 1,
Recovery: false,
NoBuild: false,
AsyncBuild: false,
}, disk, tdb, types.EmptyRootHash)
var snaps *snapshot.Tree
if rand.Intn(3) == 0 {
snaps, _ = snapshot.New(snapshot.Config{
CacheSize: 1,
Recovery: false,
NoBuild: false,
AsyncBuild: false,
}, disk, tdb, types.EmptyRootHash)
}
for i, actions := range test.actions {
root := types.EmptyRootHash
if i != 0 {
root = roots[len(roots)-1]
}
state, err := New(root, sdb, snap)
state, err := New(root, sdb, snaps)
if err != nil {
panic(err)
}