preproccessor-improvements
branch code but it fails processing oraclizeAPI.sol
code.oraclizeAPI.sol
performance issue but I could workaround it if I can skip this file.
oraclizeAPI
is known to be a serious problem for the coverage tool. It's written in a way that requires a huge number of recursive parsing steps to instrument correctly - for example many of its conditional statements are unbracketed and we have to modify that to execute branch coverage.
.solcover.js
to look like this worked for me. . . The upgradeability contracts have assembly that solidity-coverage
interferes with. And you don't need the testrpc options in your case. It just works out of the box.module.exports = {
skipFiles: ['abstractions', 'upgradeability']
};
Ganache CLI v6.1.8 (ganache-core: 2.2.1)
this one worked from the get go. revert codes are game changer in testing :) so yes if you could update the packages I'd be really grateful
6.1.6
they started passing back the return data and Truffle V5 was able to do the message decoding on it's side. In 6.1.8 they decided to add the code to the error message string on the ganache side. trufflesuite/ganache-core@a04585c
ganache-cli
, but something is wrong for me. I created own fork of testrpc-sc
(https://github.com/Exef/testrpc-sc ) which I updated using ganache-cli
master branch. Next I build it, and published it to npm under https://www.npmjs.com/package/ethereumjs-testrpc-sc-fork. I used this as a new dependency of my fork of solidity-coverage
(https://github.com/Exef/solidity-coverage/tree/develop). All test passes using new dependency, so for tests I pushed it to npm as https://www.npmjs.com/package/solidity-coverage-fork. I've also corrected all places that used solidity-coverage
instead of solidity-coverage-fork
(especially require.resolve
in app.js). Unfortunately something goes wrong and my truffle package during running solidity-coverage
command errors with Error: Cannot find module 'ethereumjs-testrpc-sc-fork/build/cli.node.js'
, cause there is no build
folder inside of the node_modules/ethereumjs-testrpc-sc-fork
.
solidity-coverage
to work. I've searched and tried various things to no avail, so I've opened this issue: sc-forks/solidity-coverage#304There was a problem instrumenting ./coverageEnv/contracts/LearnToken.sol: SyntaxError: Expected ")", ",", "days", "ether", "finney", "hours", "minutes", "seconds", "szabo", "weeks", "wei", "years", comment, end of line, or whitespace but "*" found.
contract LearnToken is IBuyMechanism, BurnableToken, CappedToken(1200000000 * (10 ** uint256(18))) {
1200000000 * (10 ** uint256(18))
into 1200000000000000000000000000
?
Hey guys, are you already supporting payable addresses?
Because when I run the coverage I get:Skipping instrumentation of ./coverageEnv/contracts/Migrations.sol
Instrumenting ./coverageEnv/contracts/Owned.sol
Cleaning up...
There was a problem instrumenting ./coverageEnv/contracts/Owned.sol: SyntaxError: Expected ";", "=", comment, end of line, or whitespace but "p" found. Line: 7, Column: 21
Really great that you put a tool out there for test coverage :)
address payable public wallet;
coverage error: There was a problem instrumenting ./coverageEnv/contracts/AbstractPaymentQuantum.sol: SyntaxError: Expected ";", "=", comment, end of line, or whitespace but "p" found. Line: 7, Column: 21
I've troubles running coverage using:
solidity-coverage 0.5.11
Truffle v5.0.0-beta.2 (core: 5.0.0-beta.2)
[Coverage] Solidity v0.5.0 (solc-js)
I get an error like
Error: while migrating Migrations: Returned error: Exceeds block gas limit
[Coverage] at ...\node_modules\truffle\build\webpack:\packages\truffle-deployer\src\deployment.js:364:1
[Coverage] at <anonymous>
[Coverage] at process._tickCallback (internal/process/next_tick.js:188:7)
Example project can be found at : https://github.com/mstack/bootcamp-blockchain-smartcontracts/tree/master/Lab 2 in the Solidity folder.
I fixed this by using nodetouch allFiredEvents
Example coverage command:
`"coverage": "npm run clean && nodetouch allFiredEvents && concurrently --names \"GanacheCLI,Coverage\" --kill-others \"node_modules\\.bin\\ganache-cli --quiet --port 8555 --gasPrice 0x01 --gasLimit 0xfffffffffff --allowUnlimitedContractSize\" \"node_modules\\.bin\\solidity-coverage\" || true",
ParsedContract.sol:129:6: ParserError: Expected ';' but got 'emit'