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

Bug fix for large binary with unlink libraries codegen #2016

Merged

Conversation

tonykwok1992
Copy link
Contributor

@tonykwok1992 tonykwok1992 commented Mar 15, 2024

What does this PR do?

Bug fix for large binary with unlinked libraries codegen

Where should the reviewer start?

All files

Why is it needed?

solidity bytecode with unlinked libraries can contain dollar sign (https://docs.soliditylang.org/en/latest/using-the-compiler.html) in the form of __$hashed$__. This could potentially being interpreted as string placeholder for args replacement in Java poet, in the case that cause failure in particular is __$927c5a12e2f339676f56d42ec1c0537964$__ (the $927c part). The code that contain this bug only at the case for large binary (length > 65534). The safest way to fix is just to escape all dollar using javapoet's escape rule

square/javapoet#670

Copy link

codecov bot commented Mar 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.22%. Comparing base (d86b993) to head (e86ee2e).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2016      +/-   ##
============================================
+ Coverage     69.20%   69.22%   +0.01%     
- Complexity     3122     3123       +1     
============================================
  Files           493      493              
  Lines         13145    13146       +1     
  Branches       1695     1695              
============================================
+ Hits           9097     9100       +3     
+ Misses         3557     3556       -1     
+ Partials        491      490       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

import com.squareup.javapoet.ParameterizedTypeName;
import com.squareup.javapoet.TypeName;
import com.squareup.javapoet.TypeSpec;
import com.squareup.javapoet.*;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove wildcard import

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

@NickSneo NickSneo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gtebrean gtebrean merged commit c6afb76 into hyperledger-web3j:master Mar 21, 2024
6 checks passed
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.

3 participants