forked from TrueCloudLab/neoneo-go
smartcontract: simplify Array JSON marshalling
This commit is contained in:
parent
3dbe549a61
commit
25201d480d
1 changed files with 1 additions and 8 deletions
|
@ -82,14 +82,7 @@ func (p *Parameter) MarshalJSON() ([]byte, error) {
|
||||||
resultRawValue, resultErr = json.Marshal(hex.EncodeToString(p.Value.([]byte)))
|
resultRawValue, resultErr = json.Marshal(hex.EncodeToString(p.Value.([]byte)))
|
||||||
}
|
}
|
||||||
case ArrayType:
|
case ArrayType:
|
||||||
var value = make([]json.RawMessage, 0)
|
var value = p.Value.([]Parameter)
|
||||||
for _, parameter := range p.Value.([]Parameter) {
|
|
||||||
rawValue, err := json.Marshal(¶meter)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
value = append(value, rawValue)
|
|
||||||
}
|
|
||||||
resultRawValue, resultErr = json.Marshal(value)
|
resultRawValue, resultErr = json.Marshal(value)
|
||||||
case MapType:
|
case MapType:
|
||||||
ppair := p.Value.([]ParameterPair)
|
ppair := p.Value.([]ParameterPair)
|
||||||
|
|
Loading…
Reference in a new issue