From b9e260a704a259e42a867514d1147fff5a3fe5ff Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 19 Jun 2020 10:44:05 +0300 Subject: [PATCH] smartcontract: omit empty value in JSON for Interop/Any parameters --- pkg/smartcontract/parameter.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/smartcontract/parameter.go b/pkg/smartcontract/parameter.go index 4242cb08a..e3ce46f1e 100644 --- a/pkg/smartcontract/parameter.go +++ b/pkg/smartcontract/parameter.go @@ -53,7 +53,7 @@ func NewParameter(t ParamType) Parameter { type rawParameter struct { Type ParamType `json:"type"` - Value json.RawMessage `json:"value"` + Value json.RawMessage `json:"value,omitempty"` } // MarshalJSON implements Marshaler interface. @@ -88,7 +88,7 @@ func (p *Parameter) MarshalJSON() ([]byte, error) { ppair := p.Value.([]ParameterPair) resultRawValue, resultErr = json.Marshal(ppair) case InteropInterfaceType, AnyType: - resultRawValue = []byte("null") + resultRawValue = nil default: resultErr = errors.Errorf("Marshaller for type %s not implemented", p.Type) }