rpc: fix JSON marshalling for Invoke result

We should return a quote string as JSON value in case of recursive
reference, otherwise json.Marshal returns an error.
This commit is contained in:
Anna Shaleva 2020-09-07 13:33:05 +03:00
parent acacac1b24
commit 27348973c3

View file

@ -29,7 +29,7 @@ func (r Invoke) MarshalJSON() ([]byte, error) {
for i := range arr {
data, err := stackitem.ToJSONWithTypes(r.Stack[i])
if err != nil {
st = []byte("error: recursive reference")
st = []byte(`"error: recursive reference"`)
break
}
arr[i] = data