-
Couldn't load subscription status.
- Fork 97
Open
Description
Hi,
I found when calling contract from cli with empty array input would cause this error:
ERROR: Error calling constant function: invalid hex address:
I think the root cause should be that strings.Split on empty string results in a slice with one empty string ([""]) instead of 0-length ([]).
Lines 462 to 469 in c84726a
| case abi.SliceTy, abi.ArrayTy: | |
| s, ok := param.(string) | |
| if !ok { | |
| return nil, fmt.Errorf("invalid array: %s", s) | |
| } | |
| s = strings.TrimPrefix(s, "[") | |
| s = strings.TrimSuffix(s, "]") | |
| inputArray := strings.Split(s, ",") |
I can submit a PR if needed.
Thanks.
Metadata
Metadata
Assignees
Labels
No labels