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

Instrumenting solidity 0.5.x contracts with calldata keyword. #316

Closed
Amxx opened this issue Jan 28, 2019 · 8 comments
Closed

Instrumenting solidity 0.5.x contracts with calldata keyword. #316

Amxx opened this issue Jan 28, 2019 · 8 comments

Comments

@Amxx
Copy link

Amxx commented Jan 28, 2019

When running solidity coverage, I am getting an error:

There was a problem instrumenting ./coverageEnv/contracts/XXX.sol: SyntaxError: Expected ")", ",", comment, end of line, or whitespace but "_" found. Line: 50, Column: 20

Line 50 is of XXX.sol is:

49.	function myMethod(
50.		string  calldata _firstArg,
51.		bytes32 _secondArg,

If I remove the calldata keyword my code will not compile using the classical workflow, and I'd like to avoid having a specific version of my code for running solidity-coverage

@MariusVanDerWijden
Copy link

Same issue as here: raineorshine/solgraph#39
Can be fixed by replacing the "solidity-parser-sc" with "solidity-parser-antlr"

@Amxx
Copy link
Author

Amxx commented Jan 30, 2019

I installed solidity-parser-antlr, but my guess is I need to rebuild solidity-coverage and the documentation doesn't explain how to do this

@MariusVanDerWijden
Copy link

The developers of solidity-coverage have to rewrite parts of their code to accommodate the different output of "solidity-parser-antlr". You, as a user, can not do it without significant knowledge of the codebase

@sirhill
Copy link

sirhill commented Feb 3, 2019

I have the same exact error with the 'payable' keyword. Should I open a separate issue ?

@MariusVanDerWijden
Copy link

No, I found a workaround here: sc-forks/solidity-parser#18,
you have to replace the parser.js file in node-modules/solidity-parser-sc/build/ with this https://raw.githubusercontent.com/maxsam4/solidity-parser/solidity-0.5/build/parser.js.

I think it is time to fork these projects away from sc-forks

@pinkiebell
Copy link
Contributor

TL;DR: https://github.com/leapdao/solidity-coverage.git#master

FYI, we have the solidity-coverage and -parser now under our leapDAO umbrella.
This includes support for calldata, payable and inline function declarations as of now.

area added a commit that referenced this issue Mar 2, 2019
@area
Copy link
Contributor

area commented Mar 2, 2019

I am working on a release that supports solidity 0.5.1, based on the leapdao fork @pinkiebell has mentioned in #318 which should fix your issue - I would be interested in any other odd behaviour you stumbled across while trying it out.

@cgewecke
Copy link
Member

Fixed in 0.6.0

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

No branches or pull requests

6 participants