mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
Update state_test_util.go
This commit is contained in:
parent
f0d10a6abb
commit
0c93a4007e
1 changed files with 1 additions and 3 deletions
|
|
@ -196,11 +196,9 @@ func (t *StateTest) checkError(subtest StateSubtest, err error) error {
|
||||||
// Run executes a specific subtest and verifies the post-state and logs
|
// Run executes a specific subtest and verifies the post-state and logs
|
||||||
func (t *StateTest) Run(subtest StateSubtest, vmconfig vm.Config, snapshotter bool, scheme string, postCheck func(err error, snaps *snapshot.Tree, state *state.StateDB)) (result error) {
|
func (t *StateTest) Run(subtest StateSubtest, vmconfig vm.Config, snapshotter bool, scheme string, postCheck func(err error, snaps *snapshot.Tree, state *state.StateDB)) (result error) {
|
||||||
triedb, snaps, statedb, root, err := t.RunNoVerify(subtest, vmconfig, snapshotter, scheme)
|
triedb, snaps, statedb, root, err := t.RunNoVerify(subtest, vmconfig, snapshotter, scheme)
|
||||||
|
|
||||||
// Invoke the callback at the end of function for further analysis.
|
// Invoke the callback at the end of function for further analysis.
|
||||||
defer func() {
|
defer func() {
|
||||||
postCheck(result, snaps, statedb)
|
postCheck(result, snaps, statedb)
|
||||||
|
|
||||||
if triedb != nil {
|
if triedb != nil {
|
||||||
triedb.Close()
|
triedb.Close()
|
||||||
}
|
}
|
||||||
|
|
@ -208,6 +206,7 @@ func (t *StateTest) Run(subtest StateSubtest, vmconfig vm.Config, snapshotter bo
|
||||||
snaps.Release()
|
snaps.Release()
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
checkedErr := t.checkError(subtest, err)
|
checkedErr := t.checkError(subtest, err)
|
||||||
if checkedErr != nil {
|
if checkedErr != nil {
|
||||||
return checkedErr
|
return checkedErr
|
||||||
|
|
@ -244,7 +243,6 @@ func (t *StateTest) RunNoVerify(subtest StateSubtest, vmconfig vm.Config, snapsh
|
||||||
// generate.go:generate(). This goroutine cannot exit until the abort-stats
|
// generate.go:generate(). This goroutine cannot exit until the abort-stats
|
||||||
// can be delivered, either via a call to Journal or e.g Disable.
|
// can be delivered, either via a call to Journal or e.g Disable.
|
||||||
triedb, snaps, statedb = MakePreState(rawdb.NewMemoryDatabase(), t.json.Pre, snapshotter, scheme)
|
triedb, snaps, statedb = MakePreState(rawdb.NewMemoryDatabase(), t.json.Pre, snapshotter, scheme)
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
triedb.Close()
|
triedb.Close()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue