Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using java keywords as solidity function names #776

Merged
merged 2 commits into from Nov 14, 2018

Conversation

iikirilov
Copy link
Contributor

@iikirilov iikirilov commented Nov 7, 2018

What does this PR do?

Prepend the violating function name with "_" such that a solidity function called double will generate a java method called _double. This fixes #658

I am open to making this more extensible if required. For example, one could configure their own sanitizing string and specify whether it should be appended or prepended. An issue was opened on the JavaPoet github square/javapoet#690 - looks like we will have to implement ourselves in the future.

Where should the reviewer start?

SolidityFunctionWrapper

Why is it needed?

Because Solidity contract writers should not need to worry about Java keywords.

if it is a reserved keyword in the current java version
@codecov
Copy link

codecov bot commented Nov 7, 2018

Codecov Report

Merging #776 into master will decrease coverage by 0.14%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #776      +/-   ##
============================================
- Coverage     77.38%   77.24%   -0.15%     
+ Complexity     1851     1850       -1     
============================================
  Files           241      241              
  Lines          6814     6816       +2     
  Branches       1012     1013       +1     
============================================
- Hits           5273     5265       -8     
- Misses         1291     1301      +10     
  Partials        250      250
Impacted Files Coverage Δ Complexity Δ
...ava/org/web3j/codegen/SolidityFunctionWrapper.java 93.98% <100%> (+0.01%) 123 <0> (+1) ⬆️
...n/java/org/web3j/protocol/core/filters/Filter.java 53.12% <0%> (-14.07%) 8% <0%> (-2%)
...org/web3j/protocol/websocket/WebSocketService.java 85.26% <0%> (-1.06%) 50% <0%> (-1%)
core/src/main/java/org/web3j/utils/Flowables.java 88% <0%> (+4%) 11% <0%> (+1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6160282...e35745a. Read the comment docs.

@snazha-blkio snazha-blkio added this to the 4.0.0-alpha-2 milestone Nov 11, 2018
@iikirilov iikirilov added needs-review issue/PR needs review from maintainer and removed needs-ci-approvals labels Nov 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants