good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit 02cea233 authored by Marius van der Wijden's avatar Marius van der Wijden Committed by GitHub
Browse files

eth: returned revert reason in traceTx (#21195)

* eth: returned revert reason in traceTx

* eth: return result data
parent 413358ab
No related branches found
No related tags found
No related merge requests found
......@@ -765,10 +765,15 @@ func (api *PrivateDebugAPI) traceTx(ctx context.Context, message core.Message, v
// Depending on the tracer type, format and return the output
switch tracer := tracer.(type) {
case *vm.StructLogger:
// If the result contains a revert reason, return it.
returnVal := fmt.Sprintf("%x", result.Return())
if len(result.Revert()) > 0 {
returnVal = fmt.Sprintf("%x", result.Revert())
}
return &ethapi.ExecutionResult{
Gas: result.UsedGas,
Failed: result.Failed(),
ReturnValue: fmt.Sprintf("%x", result.Return()),
ReturnValue: returnVal,
StructLogs: ethapi.FormatLogs(tracer.StructLogs()),
}, nil
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment