Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    George Spasov
    @Perseverance
    I hate for etherlime to be pointing to our own fork repo
    Juwita W
    @juwitaw
    Hi guys, I'm facing error instrumenting when using solidity-coverage on my ERC-20 contract. It said There 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.
    on line above
    contract LearnToken is IBuyMechanism, BurnableToken, CappedToken(1200000000 * (10 ** uint256(18))) {
    Any idea how to resolve this beside changing 1200000000 * (10 ** uint256(18)) into 1200000000000000000000000000?
    simonschmoll
    @simonschmoll

    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 :)

    fpaun23
    @fpaun23
    Good question @simonschmoll , I have the same issue with a contract I am working on.
    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
    As I can see it is not supported and the question would be if is there any solution for this at this moment?
    Stef Heyenrath
    @StefH
    @fpaun23 : I noticed the same. For now I did remove payable from my address.
    Stef Heyenrath
    @StefH

    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.

    Stef Heyenrath
    @StefH
    It seems to work now. I did change some settings. If you want to know the details, take a look at that Lab 2 or Lab 4 solutions in that GitHub project.
    SolidityPower
    @SolidityDev_twitter

    Hello, I am getting this error:

    Event trace could not be read.
    Error: ENOENT: no such file or directory, open './allFiredEvents'

    How can I fix this?

    Stef Heyenrath
    @StefH

    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",
    Guy Lando
    @guylando
    no matter what I do solidity-coverage runs out of gas (while normal test does not run out of gas). I even increased ganache gas limit to 40 million and truffle config coverage network gas limit to 20 million and still nothing helps. any ideas?
    transaction with 1,000,000,000 gas still ran out of gas
    Guy Lando
    @guylando
    solved by adding --allowUnlimitedContractSize parameter to testchain
    0age
    @0age
    Hi there - running into an issue using 0.6.0-beta.5 and Solidity 0.5.8 where instrumentation is inserting events in require statements between the close parenthesis and the semicolon, i.e. require(value == true, "value cannot be false")<emit __BAD_INSTRUMENTATION_GOING_HERE>;
    Getting ParsedContract.sol:129:6: ParserError: Expected ';' but got 'emit'
    Any idea what could be causing this or how to go about fixing it? I wasn't hitting this error back when the contract was pared down a bit from its current size if it's any help
    0age
    @0age
    Found the cause - I had emojis in the comments
    removing them fixed the coverage - interesting edge-case!
    area
    @area
    Ah, right, the old 'how many characters is a Unicode character' dilemma
    Never considered that :)
    0age
    @0age
    Well most sane devs never considered putting emoji in their comments!
    Makoto Inoue
    @makoto
    @cgewecke hello. Do you have any plan about when to release 0.7 mentioned at https://github.com/sc-forks/solidity-coverage/issues/355#issuecomment-514862829 ?
    cgewecke
    @cgewecke
    Hi @makoto, there should be a beta version ready by the end of August. Do you have a repo you would like to use this in? We could use it as a test target for 0.7.0 to make sure everything works ok.
    cgewecke
    @cgewecke
    @makoto The work on 0.7.0 is happening in #357, design discussion for it is happening in #346.
    Makoto Inoue
    @makoto
    I am currently using it at https://github.com/wearekickback/contracts
    I am in the middle of making big change and test coverage started failing even though the same test passes if I run as normal test
    Keen to try out if the latest could fix what I a encountering
    cgewecke
    @cgewecke
    @makoto I opened a PR at wearekickback which might fix: wearekickback/contracts#27
    Makoto Inoue
    @makoto
    ah thanks. I will give a try
    Makoto Inoue
    @makoto
    @cgewecke it passed!!! You are genious!
    Xiao Liang
    @yxliang01
    @cgewecke Happy to see you release 0.7 beta! Thanks for your effort :) This is going to be very helpful. :rocket:
    cgewecke
    @cgewecke
    Thanks @yxliang01!
    Richard Abambillah
    @Anthler

    Hello, I integrated solidity-coverage with my smart contract and I run into these issues. Is there any help or workaround

    TypeError: Overriding function changes state mutability from "view" to "nonpayable". function acceptRelayedCall( ^ (Relevant source part starts here and spans across multiple lines). tabookey-gasless/contracts/IRelayRecipient.sol:35:5: Overridden function is here: function acceptRelayedCall(address ... alData) public view returns (uint); ^-------------------------------------------------------------------------^

    cgewecke
    @cgewecke
    Hi @Anthler - Could you try with the 0.7.0 beta? It avoids rewriting state-mutability modifiers so this error shouldn't occur there...
    npm install --save-dev solidity-coverage@beta
    The installation instructions are different...the beta README is here: https://github.com/sc-forks/solidity-coverage/tree/beta#install
    Richard Abambillah
    @Anthler
    Thank you so much @cgewecke it works now
    Richard Abambillah
    @Anthler
    @cgewecke I'm using the beta version now and everything works but this is the error I get now SchLoToken has no network configuration for its current network id (*). ? How do I resove this ? I added several configurations in .solcover and truffle.js but none helped
    cgewecke
    @cgewecke
    @Anthler Do you have a link to your project I could look at, or could you post the truffle-config.js here? One thing you might try as quick check is to run the command with the --network flag, specifying the network you usually use with your tests:
    truffle run coverage --network  <your-test-network-name>
    Richard Abambillah
    @Anthler
    @cgewecke Thank you for your response , I did supply the --network command-line argument and there was no luck, I also added providerOptions object in .solcover.js also tried running local ganache-cli with a network_id and all had no luck.
    Richard Abambillah
    @Anthler
    Below is my truffle-config.js. By adding coverage object and also removing it in truffle-config.js didn't work, also changing the port for development network to port 8555 and 8545 for both coverage and development network still didn't work. The token contract is just a contract that extends openzeppelin ERC20 contract
     development: {
          host: '127.0.0.1',
          port: 8545,
          network_id: '*', // Match any network id
        },
        coverage: {
          host: 'localhost',
          network_id: '*',
          port: 8555,         // <-- If you change this, also set the port option in .solcover.js.
          gas: 0xfffffffffff, // <-- Use this high gas value
          gasPrice: 0x01      // <-- Use this low gas price
        }
    cgewecke
    @cgewecke
    @Anthler What do you see when you run truffle run coverage --network development?
    @Anthler How are you running truffle test?
    cgewecke
    @cgewecke
    Lastly, what version of Truffle are you using?
    Richard Abambillah
    @Anthler
    @cgewecke I'm using truffle version 5.0.38, test command is npm run test and --developmentproduces same error has no network configuration for its current network id (*).
    cgewecke
    @cgewecke
    @Anthler As a baseline test, I've just run Truffle's metacoin project with solidity-coverage@beta and Truffle 5.0.38 and everything worked as expected.... Truffle is globally installed, and my command was: truffle run coverage.
    Without seeing the code in your project it's hard to debug the problem your having further. Is there any way you could put up on Github so I can take a look and see what's going wrong?
    Richard Abambillah
    @Anthler
    Ok sure I'll keep u updated