Commit d965040
committed
Output function name with the first letter lowercase from camelCase
We introduced `toCamelCase` to use the same function name normalization
strategy as go-ethereum and support functions like `__beaconCallback`.
This change broke `ethereum` command. The subcommands for ethereum methods
were being prefixed by `-`. urfave/cli, the library we use for CLI
definition and parsing, does not fail if subcommands prefixed by - are used.
However, it does fail to recognize them; instead, it tries to recognize them
as flags, and flags with that name have not been defined.
`toCamelCase` used to uppercase the first letter. Later, in
`buildMethodInfo` where we create `dashedName` we were prefixing the
function name with `-` with uppercase-first letter.
The fix is easy, we need to ensure the first letter stays lowercase during
the normalization. Later, in `buildMethodInfo`, we specify explicitly where
do we want lowercase and uppercase with `uppercaseFirst` and `lowercaseFirst`.1 parent bf7dfa6 commit d965040
File tree
2 files changed
+45
-6
lines changed- tools/generators/ethereum
2 files changed
+45
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
281 | | - | |
282 | 281 | | |
283 | 282 | | |
284 | 283 | | |
285 | 284 | | |
286 | 285 | | |
287 | 286 | | |
288 | 287 | | |
289 | | - | |
290 | 288 | | |
291 | 289 | | |
292 | 290 | | |
293 | | - | |
| 291 | + | |
294 | 292 | | |
295 | 293 | | |
296 | 294 | | |
297 | 295 | | |
298 | 296 | | |
299 | 297 | | |
300 | | - | |
| 298 | + | |
301 | 299 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
0 commit comments