Skip to content

Commit dee1b1b

Browse files
committed
cmd/evm: simplify blockrunner
1 parent 1e2b109 commit dee1b1b

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

cmd/evm/blockrunner.go

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@ package main
1919
import (
2020
"encoding/json"
2121
"errors"
22+
"fmt"
2223
"os"
2324

24-
"github.com/ethereum/go-ethereum/core/state"
2525
"github.com/ethereum/go-ethereum/log"
2626
"github.com/ethereum/go-ethereum/tests"
27-
2827
"github.com/urfave/cli/v2"
2928
)
3029

@@ -35,16 +34,6 @@ var blockTestCommand = &cli.Command{
3534
ArgsUsage: "<file>",
3635
}
3736

38-
// BlocktestResult contains the execution status after running a blockchain test, any
39-
// error that might have occurred and a dump of the final blockchain if requested.
40-
type BlocktestResult struct {
41-
Name string `json:"name"`
42-
Pass bool `json:"pass"`
43-
Fork string `json:"fork"`
44-
Error string `json:"error,omitempty"`
45-
State *state.Dump `json:"state,omitempty"`
46-
}
47-
4837
func blockTestCmd(ctx *cli.Context) error {
4938
if len(ctx.Args().First()) == 0 {
5039
return errors.New("path-to-test argument required")
@@ -63,9 +52,9 @@ func blockTestCmd(ctx *cli.Context) error {
6352
if err = json.Unmarshal(src, &tests); err != nil {
6453
return err
6554
}
66-
for _, test := range tests {
55+
for i, test := range tests {
6756
if err := test.Run(false); err != nil {
68-
return err
57+
return fmt.Errorf("test %v: %w", i, err)
6958
}
7059
}
7160
return nil

0 commit comments

Comments
 (0)