mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-22 19:29:39 +00:00
smartcontract: omit empty value in JSON for Interop/Any parameters
This commit is contained in:
parent
3a0be5ce28
commit
b9e260a704
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue