mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 01:41:36 +00:00
accounts/abi: array-parse error reports the wrong character (#35106)
This commit is contained in:
parent
13d8df63f4
commit
f1b2573dda
1 changed files with 5 additions and 2 deletions
|
|
@ -75,8 +75,11 @@ func parseElementaryType(unescapedSelector string) (string, string, error) {
|
||||||
parsedType = parsedType + string(rest[0])
|
parsedType = parsedType + string(rest[0])
|
||||||
rest = rest[1:]
|
rest = rest[1:]
|
||||||
}
|
}
|
||||||
if len(rest) == 0 || rest[0] != ']' {
|
if len(rest) == 0 {
|
||||||
return "", "", fmt.Errorf("failed to parse array: expected ']', got %c", unescapedSelector[0])
|
return "", "", fmt.Errorf("failed to parse array: expected ']', got end of string")
|
||||||
|
}
|
||||||
|
if rest[0] != ']' {
|
||||||
|
return "", "", fmt.Errorf("failed to parse array: expected ']', got %c", rest[0])
|
||||||
}
|
}
|
||||||
parsedType = parsedType + string(rest[0])
|
parsedType = parsedType + string(rest[0])
|
||||||
rest = rest[1:]
|
rest = rest[1:]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue