mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
core/state: random enable fast/slow deletion
This commit is contained in:
parent
297a3bd697
commit
e923d89d52
1 changed files with 10 additions and 8 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue