mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-17 13:36:37 +00:00
add back code that got mistakenly removed in the rebase
This commit is contained in:
parent
c6f7571c5e
commit
8a65262e98
1 changed files with 8 additions and 0 deletions
|
|
@ -266,6 +266,14 @@ func bind(types []string, abis []string, bytecodes []string, fsigs []map[string]
|
||||||
|
|
||||||
// Ensure there is no duplicated identifier
|
// Ensure there is no duplicated identifier
|
||||||
normalizedName := methodNormalizer(alias(aliases, original.Name))
|
normalizedName := methodNormalizer(alias(aliases, original.Name))
|
||||||
|
// Name shouldn't start with a digit. It will make the generated code invalid.
|
||||||
|
if len(normalizedName) > 0 && unicode.IsDigit(rune(normalizedName[0])) {
|
||||||
|
normalizedName = fmt.Sprintf("E%s", normalizedName)
|
||||||
|
normalizedName = abi.ResolveNameConflict(normalizedName, func(name string) bool {
|
||||||
|
_, ok := eventIdentifiers[name]
|
||||||
|
return ok
|
||||||
|
})
|
||||||
|
}
|
||||||
if eventIdentifiers[normalizedName] {
|
if eventIdentifiers[normalizedName] {
|
||||||
return nil, fmt.Errorf("duplicated identifier \"%s\"(normalized \"%s\"), use --alias for renaming", original.Name, normalizedName)
|
return nil, fmt.Errorf("duplicated identifier \"%s\"(normalized \"%s\"), use --alias for renaming", original.Name, normalizedName)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue