From f69451d36dc6fe11664181d013a9dfe98cbe0d42 Mon Sep 17 00:00:00 2001 From: fyrchik Date: Sun, 13 May 2018 21:32:45 +0300 Subject: [PATCH] Add Error fields to RPC responses (#84) Also add `Script` field to `InvokeResult` structure. --- VERSION | 2 +- pkg/rpc/types.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 377707783..a8b3d5c20 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.44.3 +0.44.4 diff --git a/pkg/rpc/types.go b/pkg/rpc/types.go index 9e4696208..f59ad0fe0 100644 --- a/pkg/rpc/types.go +++ b/pkg/rpc/types.go @@ -2,7 +2,8 @@ package rpc type InvokeScriptResponse struct { responseHeader - Result *InvokeResult + Error *Error `json:"error,omitempty"` + Result *InvokeResult `json:"result,omitempty"` } // InvokeResult represents the outcome of a script that is @@ -10,6 +11,7 @@ type InvokeScriptResponse struct { type InvokeResult struct { State string `json:"state"` GasConsumed string `json:"gas_consumed"` + Script string `json:"script"` Stack []*StackParam } @@ -68,5 +70,6 @@ type responseHeader struct { type response struct { responseHeader + Error *Error `json:"error"` Result interface{} `json:"result"` }