Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    cgewecke
    @cgewecke
    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
    cgewecke
    @cgewecke
    This problem is mostly about each dev stack managing contract sources, build artifacts and provider setting differently. The new design assumes they'll all have their own interface for this and some kind script (or plugin) needs to be written around the core pieces of SC to glue everything together.
    cgewecke
    @cgewecke
    This should be reasonably simple - there are a couple example plugins (for Truffle and Buidler) in the repo and am very happy to help any non-truffle tools to get something working. One of SCs design goals is to be as platform-neutral as possible.
    Elena Gesheva
    @elenadimitrova
    Thanks @cgewecke , I’ll check out the new version
    cgewecke
    @cgewecke
    @elenadimitrova If you run into difficulty and have a sample etherlime project, please just lmk - will look at it. It would be nice to develop a simple example of using the API for cases like theirs.
    Elena Gesheva
    @elenadimitrova
    @cgewecke I’m trying it with https://github.com/argentlabs/argent-contracts which is using etherlime but having problems with the built in coverage there which uses 0x coverage solution. fyi I’ve logged that issue separtely here LimeChain/etherlime#298
    cgewecke
    @cgewecke
    @elenadimitrova Ah great! I'll take a look.
    Elena Gesheva
    @elenadimitrova
    @cgewecke actually it seems that etherlime might be swtching across to solidity-coverage soon https://github.com/LimeChain/etherlime/issues/298#issuecomment-573039047
    So don’t worry too much about testing a separate setup, I can hold off a little wait for their upgrade
    cgewecke
    @cgewecke
    @elenadimitrova Ok nice, I will ping that at that issue then.
    UPPPUTURI DUSHYANTH KUMAR REDDY
    @udkreddy

    Hello,
    I am Getting compilation failed error while generation coverage, precisely after instrumentation and truffle compile is working fine
    Error:

    * Line 1, Column 1
      Syntax error: value, object or array expected.
    * Line 1, Column 2
      Extra non-whitespace after JSON value.
    Compilation failed. See above.

    My solidity version is 0.5.7
    Please check this for my truffle-config and .solcover.js https://ethereum.stackexchange.com/questions/79460/compilation-failed-during-instrumentation-of-solidity-coverage
    Could anyone help me if i am doing any mistake in config

    UPPPUTURI DUSHYANTH KUMAR REDDY
    @udkreddy
    *solidity version : 0.5.10
    "solc": "^0.5.10",
    "solidity-coverage": "^0.6.3"
    cgewecke
    @cgewecke
    @udkreddy The only thing I see is that your version is 0.6.3, but you're listing solidity-coverage as a plugin in the truffle config. You could try updating solidity-coverage to latest and looking over the upgrade guide in the README.
    At the moment the only instrumentation faults we know of on 0.7.x are caused by non-unicode characters in the Solidity (like scientific notation or emojis in the natspec comments). And solc 0.6.x.
    If you still have problems, you'll have to link to the code somewhere so we can debug further.
    UPPPUTURI DUSHYANTH KUMAR REDDY
    @udkreddy

    updated solidity-coverage version to 0.7.1 and truffle 5.0.31
    Getting this error now, during compilation after instrumentation

    > solidity-coverage cleaning up, shutting down ganache server
    Error: TypeError: Cannot convert undefined or null to object
        at Object.compile (/home/udkreddy/Dushyanth/NexusMutual/nxm-smart-contracts/node_modules/truffle/build/webpack:/packages/truffle-workflow-compile/legacy/index.js?6101:72:1)
        at <anonymous>

    Find repo here : https://github.com/udkreddy/nxm-smart-contracts/tree/coverage-fix

    cgewecke
    @cgewecke
    @udkreddy Checked out your repo. It looks like we are having a problem instrumenting the version of usingOraclize.sol you're using. Still experimenting (it takes quite a while for your tests to launch) but there is a gist of some changes you could make to get the tests running here:
    cgewecke
    @cgewecke
    @udkreddy Apologies, I see that you need coverage to run on port 8545 because there are web3 calls in some of your tests before blocks...will need to edit that gist a bit. Let me see if I can get a clean test run and then you will have all the changes you need.
    UPPPUTURI DUSHYANTH KUMAR REDDY
    @udkreddy
    Thanks for response @cgewecke ,
    will check making changes per gist
    cgewecke
    @cgewecke

    @udkreddy I haven't been able to get the tests to run to completion - the setup takes a really long time - I don't know if it's due to the coverage tool because I can't get the regular tests to run. If you add a network flag to...

    npx truffle run coverage --network development

    in test.sh, coverage will use 8545 but the before block for the first test just seems to hang. If you omit the network flag, eventually you will see some tests running but some of the before blocks error because they are using the wrong port to make Web3 calls.

    UPPPUTURI DUSHYANTH KUMAR REDDY
    @udkreddy
    My bad, errors in testcases were due to updated truffle version, so need to make changes as per newer version.
    Resolved those errors and now able to run regular testcases, but for coverage getting same error.
    Will check removing web3 calls from testcases.
    UPPPUTURI DUSHYANTH KUMAR REDDY
    @udkreddy
    Thank you,
    Got it working after resolving port issue with web3