Fix prettier removing payable from address payable#77
Fix prettier removing payable from address payable#77mattiaerre merged 4 commits intoprettier-solidity:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #77 +/- ##
==========================================
- Coverage 85.43% 84.46% -0.98%
==========================================
Files 5 5
Lines 206 206
Branches 45 45
==========================================
- Hits 176 174 -2
- Misses 28 30 +2
Partials 2 2
Continue to review full report at Codecov.
|
|
Fixed some styling issues, also federicobond/solidity-parser-antlr#40 the new version was released so this should be mergable |
|
@svechinsky could you add tests for this? |
|
thanks for this PR @svechinsky if you can add a test that would be really appreciated if you cannot please comment w/ an example from a contract where you've noticed the issue and we'll add the test for you as we'd like to make sure that the fix doesn't introduce any regression as well as improve the overall code coverage // cc @fvictorio |
|
I won't be able to write the test myself but will post an example later
today.
…On Thu, 27 Dec 2018 at 03:30, mattia richetto ***@***.***> wrote:
thanks for this PR @svechinsky <https://github.com/svechinsky> if you can
add a test that would be really appreciated if you cannot please comment w/
an example from a contract where you've noticed the issue and we'll add the
test for you as we'd like to make sure that the fix doesn't introduce
regression as well as improve the overall code coverage
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#77 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ATCAqzZM-_SA-rh0nvQTnli-CeuKg151ks5u9CK0gaJpZM4ZfFdW>
.
|
|
thanks @svechinsky |
|
So if you run prettier on this function the payable part will be removed (both in the parameters as well as in the declaration). contract AddressPayable{
function sendSomeEth(address payable to){
address payable target = to;
target.transfer(100 eth);
}
} |
|
hi @svechinsky can you grant me write access to your fork so that I can push the test? otherwise you can add the attached folder to the project under |
|
Added the tests. @mattiaerre, just FYI, you can push to a forked repo when there's a pull request like this 🙂 |
|
This closes #78, right? |
mattiaerre
left a comment
There was a problem hiding this comment.
this LGTM thanks @fvictorio
So I noticed an issue with the new address payable type.
At first the plugin would fail because the published version of solidity-parser-antlr had a bug and didn't recognize the payable keyword.
After using the most recent version from git I noticed that the printer would just remove the payable keyword.
So this PR fixes this.
I have absolutley no idea if what I did here is the correct way to fix it but it seems to work for me.
Also I have no idea what's the best way to include the most recent version of solidity-parser-antlr, maybe best to ask the maintainer to publish the newest version?