forked from TrueCloudLab/frostfs-node
[#1141] morph/client: Use boolean type directly
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
230a5cd037
commit
f65898a354
2 changed files with 4 additions and 13 deletions
|
@ -487,15 +487,8 @@ func toStackParameter(value interface{}) (sc.Parameter, error) {
|
||||||
|
|
||||||
return toStackParameter(arr)
|
return toStackParameter(arr)
|
||||||
case bool:
|
case bool:
|
||||||
// FIXME: #1141 there are some problems with BoolType in neo-go,
|
result.Type = sc.BoolType
|
||||||
// so we use compatible type
|
result.Value = v
|
||||||
result.Type = sc.IntegerType
|
|
||||||
|
|
||||||
if v {
|
|
||||||
result.Value = int64(1)
|
|
||||||
} else {
|
|
||||||
result.Value = int64(0)
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
return result, wrapNeoFSError(fmt.Errorf("chain/client: unsupported parameter %v", value))
|
return result, wrapNeoFSError(fmt.Errorf("chain/client: unsupported parameter %v", value))
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,13 +34,11 @@ func TestToStackParameter(t *testing.T) {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: false,
|
value: false,
|
||||||
expType: sc.IntegerType,
|
expType: sc.BoolType,
|
||||||
expVal: int64(0),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: true,
|
value: true,
|
||||||
expType: sc.IntegerType,
|
expType: sc.BoolType,
|
||||||
expVal: int64(1),
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue