Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    0age
    @0age
    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
    Cyril Lapinte
    @sirhill
    Happy new year everyone.
    I am having fun with solc 0.6.0. It seems to me that solidity-coverage 0.7.0 does not support the abstract keyword.

    During instrumentation:

    interface/IERC20.sol
    solidity-coverage cleaning up, shutting down ganache server
    ParserError: Could not instrument: interface/IERC20.sol. (Please verify solc can compile this file without errors.) extraneous input 'abstract' expecting {<EOF>, 'pragma', 'import', 'contract', 'interface', 'library'} (9:0)

    I believe the plugin should just ignore interface like contract, isn't it? Or am I doing something wrong?
    cgewecke
    @cgewecke
    It seems to me that solidity-coverage 0.7.0 does not support the abstract keyword
    Cyril Lapinte
    @sirhill
    What is the question @cgewecke ?
    cgewecke
    @cgewecke
    @sirhill Hi, happy new year! Yes there are several problems with solc 0.6.0 that need to be resolved. Tracking them in sc-forks/solidity-coverage#464
    Cyril Lapinte
    @sirhill
    Awesome and it's all fine then. :-)
    cgewecke
    @cgewecke
    Will add abstract to that list.... SC uses as JS solidity parser whose grammar needs a bunch of updates.
    Cyril Lapinte
    @sirhill
    Thanks a lot for the amazing work!
    cgewecke
    @cgewecke
    And there are a bunch of other tools like linters that rely on it...hopefully the fixes will get written and published shortly. Thanks so much!
    But TLDR; solc 0.6.0 won't be supported for a bit.
    Elena Gesheva
    @elenadimitrova
    @cgewecke @DimitarSD @Perseverance guys there were conversations about etherlime working with solidity-coverage before. Do you currently support this scenario? I am hitting a lot of issues trying to either use the etherlime coverage functionality (which utilises 0x coverage tool under the bonnet) or use the solidity-coverage on top of an etherlime project. I don’t get why the tools have to be so tied in with the test/deploy framework underneath, i.e. solidity-coverage with truffle and etherlime with 0x coverage
    cgewecke
    @cgewecke
    Hi @elenadimitrova - solidity-coverage's newest version (0.7.0) tries to address the platform dependence problem by publishing an API. There's documentation for it here: https://github.com/sc-forks/solidity-coverage/blob/master/docs/api.md#solidity-coverage-api
    I don’t get why the tools have to be so tied in with the test/deploy framework underneath, i.e. solidity-coverage with truffle and etherlime with 0x coverage