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)))
|
||||
}
|
||||
case ArrayType:
|
||||
var value = make([]json.RawMessage, 0)
|
||||
for _, parameter := range p.Value.([]Parameter) {
|
||||
rawValue, err := json.Marshal(¶meter)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
value = append(value, rawValue)
|
||||
}
|
||||
var value = p.Value.([]Parameter)
|
||||
resultRawValue, resultErr = json.Marshal(value)
|
||||
case MapType:
|
||||
ppair := p.Value.([]ParameterPair)
|
||||
|
|
Loading…
Reference in a new issue