rpc/request: return error from ExpandArrayIntoScript
if any
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
c72b3f2176
commit
037076f2ee
2 changed files with 5 additions and 1 deletions
|
@ -97,7 +97,7 @@ func ExpandArrayIntoScript(script *io.BinWriter, slice []Param) error {
|
|||
return fmt.Errorf("parameter type %v is not supported", fp.Type)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
return script.Err
|
||||
}
|
||||
|
||||
// CreateFunctionInvocationScript creates a script to invoke given contract with
|
||||
|
|
|
@ -135,6 +135,10 @@ func TestExpandArrayIntoScript(t *testing.T) {
|
|||
{
|
||||
{RawMessage: []byte(`{"type": "Array", "value": null}`)},
|
||||
},
|
||||
{
|
||||
{RawMessage: []byte(`{"type": "Integer", "value": "` +
|
||||
new(big.Int).Lsh(big.NewInt(1), 255).String() + `"}`)},
|
||||
},
|
||||
}
|
||||
for _, c := range errorCases {
|
||||
script := io.NewBufBinWriter()
|
||||
|
|
Loading…
Reference in a new issue