mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 17:33:47 +00:00
th/tracers/logger: return revert reason
The logger tracer is dropping data from a revert. Because of error wrapping the == comparison is not sufficient. errors.Is is needed.
This commit is contained in:
parent
033de2a05b
commit
4920d8127f
1 changed files with 2 additions and 1 deletions
|
|
@ -19,6 +19,7 @@ package logger
|
|||
import (
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"maps"
|
||||
|
|
@ -350,7 +351,7 @@ func (l *StructLogger) GetResult() (json.RawMessage, error) {
|
|||
returnData := common.CopyBytes(l.output)
|
||||
// Return data when successful and revert reason when reverted, otherwise empty.
|
||||
returnVal := fmt.Sprintf("%x", returnData)
|
||||
if failed && l.err != vm.ErrExecutionReverted {
|
||||
if failed && !errors.Is(l.err, vm.ErrExecutionReverted) {
|
||||
returnVal = ""
|
||||
}
|
||||
return json.Marshal(&ExecutionResult{
|
||||
|
|
|
|||
Loading…
Reference in a new issue