accounts/abi: fixed broken types slice testcases

Check for slice in type as well and adapted test case as arrays
also store its types.
This commit is contained in:
Thomas Bocek
2017-01-05 13:42:28 +01:00
committed by Péter Szilágyi
parent 47372813ef
commit 1bd9769111
2 changed files with 19 additions and 14 deletions

View File

@ -94,7 +94,7 @@ func NewType(t string) (typ Type, err error) {
// Altough we know that this is an array, we cannot return
// as we don't know the type of the element, however, if it
// is still an array, then don't determine the type.
if typ.Elem.IsArray {
if typ.Elem.IsArray || typ.Elem.IsSlice {
return typ, nil
}
}
@ -117,7 +117,12 @@ func NewType(t string) (typ Type, err error) {
varSize = 256
t += "256"
}
typ.stringKind = t
// only set stringKind if not array or slice, as for those,
// the correct string type has been set
if !(typ.IsArray || typ.IsSlice) {
typ.stringKind = t
}
switch varType {
case "int":