From be4a694003962f32f20ab3ec82023f0b6085bdde Mon Sep 17 00:00:00 2001 From: Guillaume Ballet Date: Sat, 29 Dec 2018 11:50:28 +0100 Subject: [PATCH] accounts/abi: fix case of generated java functions --- accounts/abi/bind/bind.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/accounts/abi/bind/bind.go b/accounts/abi/bind/bind.go index 21e16060c926..cf820937565b 100644 --- a/accounts/abi/bind/bind.go +++ b/accounts/abi/bind/bind.go @@ -381,7 +381,7 @@ func namedTypeJava(javaKind string, solKind abi.Type) string { // methodNormalizer is a name transformer that modifies Solidity method names to // conform to target language naming concentions. var methodNormalizer = map[Lang]func(string) string{ - LangGo: capitalise, + LangGo: abi.ToCamelCase, LangJava: decapitalise, } @@ -392,10 +392,8 @@ func capitalise(input string) string { // decapitalise makes a camel-case string which starts with a lower case character. func decapitalise(input string) string { - // NOTE: This is the current behavior, it doesn't match the comment - // above and needs to be investigated. - return abi.ToCamelCase(input) - + goForm := abi.ToCamelCase(input) + return strings.ToLower(goForm[:1]) + goForm[1:] } // structured checks whether a list of ABI data types has enough information to