smartcontract: add support for valueless Parameters
This is fine: { "type" : "Signature" },
This commit is contained in:
parent
59b4377f90
commit
cbe1eeb08c
1 changed files with 5 additions and 1 deletions
|
@ -109,7 +109,11 @@ func (p *Parameter) UnmarshalJSON(data []byte) (err error) {
|
||||||
if err = json.Unmarshal(data, &r); err != nil {
|
if err = json.Unmarshal(data, &r); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
switch p.Type = r.Type; r.Type {
|
p.Type = r.Type
|
||||||
|
if len(r.Value) == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
switch r.Type {
|
||||||
case BoolType:
|
case BoolType:
|
||||||
if err = json.Unmarshal(r.Value, &boolean); err != nil {
|
if err = json.Unmarshal(r.Value, &boolean); err != nil {
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue