[#22] Support string type in stack parameter converter

Set type of stack parameter to StringType in type-switch statement of
toStackParameter function.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-10-19 12:22:46 +03:00 committed by Alex Vanin
parent 5affabfad0
commit 54bdeb60a1
2 changed files with 6 additions and 0 deletions

View file

@ -162,6 +162,8 @@ func toStackParameter(value interface{}) (sc.Parameter, error) {
result.Type = sc.ArrayType
result.Value = arr
case string:
result.Type = sc.StringType
default:
return result, errors.Errorf("chain/client: unsupported parameter %v", value)
}

View file

@ -20,6 +20,10 @@ func TestToStackParameter(t *testing.T) {
value: int64(100),
expType: sc.IntegerType,
},
{
value: "hello world",
expType: sc.StringType,
},
}
for _, item := range items {