accounts/abi: fix case of generated java functions

This commit is contained in:
Guillaume Ballet 2018-12-29 11:50:28 +01:00
parent a4af734328
commit be4a694003

View file

@ -381,7 +381,7 @@ func namedTypeJava(javaKind string, solKind abi.Type) string {
// methodNormalizer is a name transformer that modifies Solidity method names to // methodNormalizer is a name transformer that modifies Solidity method names to
// conform to target language naming concentions. // conform to target language naming concentions.
var methodNormalizer = map[Lang]func(string) string{ var methodNormalizer = map[Lang]func(string) string{
LangGo: capitalise, LangGo: abi.ToCamelCase,
LangJava: decapitalise, LangJava: decapitalise,
} }
@ -392,10 +392,8 @@ func capitalise(input string) string {
// decapitalise makes a camel-case string which starts with a lower case character. // decapitalise makes a camel-case string which starts with a lower case character.
func decapitalise(input string) string { func decapitalise(input string) string {
// NOTE: This is the current behavior, it doesn't match the comment goForm := abi.ToCamelCase(input)
// above and needs to be investigated. return strings.ToLower(goForm[:1]) + goForm[1:]
return abi.ToCamelCase(input)
} }
// structured checks whether a list of ABI data types has enough information to // structured checks whether a list of ABI data types has enough information to