eth/tracers: fix call tracer json result
This commit is contained in:
@ -2,6 +2,7 @@ package native
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
"math/big"
|
"math/big"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@ -101,7 +102,10 @@ func (t *CallTracer) CaptureExit(output []byte, gasUsed uint64, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t *CallTracer) GetResult() (json.RawMessage, error) {
|
func (t *CallTracer) GetResult() (json.RawMessage, error) {
|
||||||
res, err := json.Marshal(t.callstack)
|
if len(t.callstack) != 1 {
|
||||||
|
return nil, errors.New("incorrect number of top-level calls")
|
||||||
|
}
|
||||||
|
res, err := json.Marshal(t.callstack[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user