forked from TrueCloudLab/frostfs-node
[#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:
parent
5affabfad0
commit
54bdeb60a1
2 changed files with 6 additions and 0 deletions
|
@ -162,6 +162,8 @@ func toStackParameter(value interface{}) (sc.Parameter, error) {
|
||||||
|
|
||||||
result.Type = sc.ArrayType
|
result.Type = sc.ArrayType
|
||||||
result.Value = arr
|
result.Value = arr
|
||||||
|
case string:
|
||||||
|
result.Type = sc.StringType
|
||||||
default:
|
default:
|
||||||
return result, errors.Errorf("chain/client: unsupported parameter %v", value)
|
return result, errors.Errorf("chain/client: unsupported parameter %v", value)
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,10 @@ func TestToStackParameter(t *testing.T) {
|
||||||
value: int64(100),
|
value: int64(100),
|
||||||
expType: sc.IntegerType,
|
expType: sc.IntegerType,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
value: "hello world",
|
||||||
|
expType: sc.StringType,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, item := range items {
|
for _, item := range items {
|
||||||
|
|
Loading…
Reference in a new issue