Skip to content

Commit be4a694

Browse files
committed
accounts/abi: fix case of generated java functions
1 parent a4af734 commit be4a694

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

accounts/abi/bind/bind.go

+3-5
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ func namedTypeJava(javaKind string, solKind abi.Type) string {
381381
// methodNormalizer is a name transformer that modifies Solidity method names to
382382
// conform to target language naming concentions.
383383
var methodNormalizer = map[Lang]func(string) string{
384-
LangGo: capitalise,
384+
LangGo: abi.ToCamelCase,
385385
LangJava: decapitalise,
386386
}
387387

@@ -392,10 +392,8 @@ func capitalise(input string) string {
392392

393393
// decapitalise makes a camel-case string which starts with a lower case character.
394394
func decapitalise(input string) string {
395-
// NOTE: This is the current behavior, it doesn't match the comment
396-
// above and needs to be investigated.
397-
return abi.ToCamelCase(input)
398-
395+
goForm := abi.ToCamelCase(input)
396+
return strings.ToLower(goForm[:1]) + goForm[1:]
399397
}
400398

401399
// structured checks whether a list of ABI data types has enough information to

0 commit comments

Comments
 (0)