cmd/evm/internal/t8ntool: fix iterator error handling in Transaction

This commit is contained in:
Felix Lange 2026-02-11 14:11:55 +01:00
parent e44cf33890
commit 38986cdb35

View file

@ -115,9 +115,6 @@ func Transaction(ctx *cli.Context) error {
}
var results []result
for it.Next() {
if err := it.Err(); err != nil {
return NewError(ErrorIO, err)
}
var tx types.Transaction
err := rlp.DecodeBytes(it.Value(), &tx)
if err != nil {
@ -188,6 +185,10 @@ func Transaction(ctx *cli.Context) error {
}
results = append(results, r)
}
if err := it.Err(); err != nil {
return NewError(ErrorIO, err)
}
out, err := json.MarshalIndent(results, "", " ")
fmt.Println(string(out))
return err