[#421] morph/client: Support keys.PublicKeys type as contract argument

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-03-23 13:06:00 +03:00 committed by Alex Vanin
parent b6ca7f1f87
commit 527daec69a

View file

@ -223,6 +223,13 @@ func toStackParameter(value interface{}) (sc.Parameter, error) {
case native.Role:
result.Type = sc.IntegerType
result.Value = int64(v)
case keys.PublicKeys:
arr := make([][]byte, 0, len(v))
for i := range v {
arr = append(arr, v[i].Bytes())
}
return toStackParameter(arr)
default:
return result, errors.Errorf("chain/client: unsupported parameter %v", value)
}