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 ([]).
|
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.
Hi,
I found when calling contract from cli with empty array input would cause this error:
I think the root cause should be that
strings.Spliton empty string results in a slice with one empty string ([""]) instead of 0-length ([]).web3/web3.go
Lines 462 to 469 in c84726a
I can submit a PR if needed.
Thanks.