Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Cyril Lapinte
    @sirhill
    Btw, if someone else ask the same question. Adding a symlink in the submodule node_modules directory solve the issue. I've commented truffle issue about it.
    cgewecke
    @cgewecke
    Thanks @sirhill!
    Célio Rodrigues
    @celioggr
    Does instrumentation works for solidity versions like 0.4.15?
    I'm geeting this error when trying to run coverage on a contract
     ParserError: Expected token LBrace got reserved keyword 'Pure'
    function coverage_0x294213b5(bytes32 c__0x294213b5) public pure {}
    cgewecke
    @cgewecke
    @celioggr Ah yes, that looks like its a problem. Are you able to use 0.4.16? That's when the pure keyword was introduced.
    Célio Rodrigues
    @celioggr
    yep! when changing the contract to solidity 0.4.16
    is there a minimum version supported?
    cgewecke
    @cgewecke
    @celioggr I guess there is at the moment (I wasn't aware of this, sorry) I will update the docs and perhaps if there is demand for supporting a lower pragma we could investigate how to support it.
    Elena Gesheva
    @elenadimitrova
    @cgewecke heya :wave: Just pinging you here before I log an issue as it maybe that you haven’t yet started catering for Solidity 0.6 features but atm transfer call to instrumented receive fallback function fails as it probably exceeds the trasnfer call gas stipend.
    I remember there was a similar issue back in the day with the 0.5 style fallback function that you had to fix
    cgewecke
    @cgewecke
    @elenadimitrova Ah ok, we have a test for that but it uses solc 0.5.x. Will investigate. Thanks!
    Elena Gesheva
    @elenadimitrova
    Thanks @cgewecke Logged it here sc-forks/solidity-coverage#516
    ameesha agrawal
    @ameesha12_gitlab
    Error: TypeError: Cannot convert undefined or null to object
        at Object.compile (/home/Desktop/smart-contracts/node_modules/truffle/build/webpack:/packages/workflow-compile/legacy/index.js:80:1)
    Truffle v5.1.10 (core: 5.1.10)
    Node v10.16.0
    I am getting this error with solidity-coverage
    truffle test is working fine
    Muhammad Yahya
    @m-yahya

    Hello everyone, I'm trying to install the solidity-coverage package by using the command npm install --save-dev solidity-coverage on Windows 10 with Node 12.
    However, I'm getting the following error:

    C:\Users\jan\dApp-nodeJS-webpack\app>npm install --save-dev solidity-coverage
    npm WARN deprecated mkdirp-promise@5.0.1: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.
    npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
    npm WARN deprecated har-validator@5.1.5: this library is no longer supported
    npm ERR! code ENOENT
    npm ERR! syscall spawn git
    npm ERR! path git
    npm ERR! errno ENOENT
    npm ERR! enoent Error while executing:
    npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/web3-js/WebSocket-Node.git
    npm ERR! enoent
    npm ERR! enoent
    npm ERR! enoent spawn git ENOENT
    npm ERR! enoent This is related to npm not being able to find a file.
    npm ERR! enoent
    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\jan\AppData\Roaming\npm-cache\_logs\2020-08-04T08_08_54_546Z-debug.log

    Steps to reproduce:

    1. Create a new empty directroy app and init npm project there
    2. run the command npm install --save-dev solidity-coverage

    I'm on Windows 10 with Node 12.
    Any help to fix the issue?
    many thanks

    JoeBlack220
    @JoeBlack220
    Hi guys, I am wondering whether I can run solidity-coverage to an external ganache instance, instead of letting it set things all up for me?
    1 reply
    ameesha agrawal
    @ameesha12_gitlab
    Yes, you can use fork option inside solcover file
    Rushikesh Acharya
    @acharyarushikesh-hspl
    @ameesha12_gitlab Can you please tell me how do I run solidity-coverage to an external ganache instance?
    Juan Castellon
    @Juan-cc
    Hi! Is it ok to receive a negative value as a result for .estimateGas() when the function that was called reverts? Or this would be an issue to report/fix? Thanks!
    Cyril Lapinte
    @sirhill
    Hello guys, I am having a weird behavior for yarn workspace+solidity-coverage+codecov.
    One of my workspace is not pushed on codecov.
    Any idea where it may comes from ?
    Cyril Lapinte
    @sirhill
    Furthermore, I've just found a regression in 0.7.10.
    TypeError: Function.prototype.apply was called on undefined, which is a undefined and not a function
        at /home/node/project/node_modules/truffle/build/webpack:/packages/workflow-compile/utils.js:34:1
        at new Promise (<anonymous>)
        at /home/node/project/node_modules/truffle/build/webpack:/packages/workflow-compile/utils.js:27:1
        at /home/node/project/node_modules/truffle/build/webpack:/packages/workflow-compile/legacy/index.js:101:1
        at Array.map (<anonymous>)
        at Object.compileSources (/home/node/project/node_modules/truffle/build/webpack:/packages/workflow-compile/legacy/index.js:91:1)
        at Object.compile (/home/node/project/node_modules/truffle/build/webpack:/packages/workflow-compile/legacy/index.js:54:1)
        at plugin (/home/node/project/node_modules/solidity-coverage/plugins/truffle.plugin.js:101:29)
        at processTicksAndRejections (internal/process/task_queues.js:97:5)
    Cyril Lapinte
    @sirhill

    I don't know how much it can help, but in anycase, my truffle version is
    Truffle v5.1.45 (core: 5.1.45)
    Solidity - 0.6.6 (solc-js)
    Node v12.18.4
    Web3.js v1.2.1

    It broken when I migrated from 0.7.4 to 0.7.10.
    Further tests I did show that it also breaking when I update other key packages to newer version.
    It breaks only for coverage. Tests do continue to works fine.

    Cyril Lapinte
    @sirhill

    Apparently, simply recreating the package lock file is suffiicient to break.
    Outside being up-to-date, I've no critical reason to upgrade at this point.

    If I need to upgrade then I would have to drop solidity-coverage (that would be a pity!).

    Abhishek Vispute
    @abhishekvispute

    Hey Hi
    Its really awesome module
    Kudos to you guys

    I have a little query.
    Though I am mentioning no of accounts explicitly in .solcover.js as 21.
    Only 10 accounts are getting created.
    Cam you please help me here

    Thanks!

    cgewecke
    @cgewecke
    @abhishekvispute Could you show what your .solcover.js looks like?
    One quirk of ganache is that the options for ganache-cli have a different format than those of ganache-core (which solidity-coverage uses to launch an in-process server)...
    The ganache-core option for number of accounts is called total_accounts
    Abhishek Vispute
    @abhishekvispute
    image.png
    Hey Hi @cgewecke
    Here it is
    Abhishek Vispute
    @abhishekvispute
    image.png
    Sorted @cgewecke
    I was using v0.7.12 and was seeing docs of v0.6 :)
    Abhishek Vispute
    @abhishekvispute
    Thanks, man
    cgewecke
    @cgewecke
    :thumbsup:
    Abhishek Vispute
    @abhishekvispute

    Hey hi guys,
    When running coverage , some tests are failing with this

    ProviderError:
    Could not connect to your Ethereum client with the following parameters:

    - host       > 127.0.0.1
    - port       > 8555
    - network_id > *

    Please check that your Ethereum client:

    - is running
    - is accepting RPC connections (i.e., "--rpc" option is used in geth)
    - is accessible over the network
    - is properly configured in your Truffle configuration file (truffle-config.js)

    Please let me know how we can solve it ?

    cgewecke
    @cgewecke
    Hi @abhishekvispute. This looks like an instance of a bug recently fixed at Truffle - see this comment: https://github.com/trufflesuite/truffle/issues/2688#issuecomment-736639231
    You should be able to resolve by setting disableConfirmationListener: true in whatever network you use to run your tests.
    And you can tell solidity-coverage to use a user-defined network via the cli with --network <network-name>
    Abhishek Vispute
    @abhishekvispute
    Thanks, man, Error Solved
    You are god, whenever I search for any issue, you are there... always :)
    Happy Holidays
    Zer0dot
    @Zer0dot
    Hey guys!
    Quick question, I'm running solidity coverage with hardhat. When I execute an rpc call to hardhat to reset my fork, it pretty much invalidates my coverage.
    Is there a way to reset forks in between test files without losing coverage?
    Zer0dot
    @Zer0dot
    My .solcover.js just has the fork and block number in the provider options
    Let me know if anyone's got a clue!
    Zer0dot
    @Zer0dot
    Nevermind got it!
    Just needed to switch from using hardhat_reset to evm_snapshot and evm_revert
    jo-es
    @jo-es
    Hi. Is it possible to combine reports from multiple test runs via solidity-coverage? I have some test which run locally via hardhat evm and some which run via hardhat mainnet forking.
    cgewecke
    @cgewecke

    @jo-es Yes, it's possible! There's a (rough draft) recipe of how do this in a Circle CI script here:

    https://github.com/SetProtocol/index-coop-smart-contracts/blob/3b1521d0212b82477bcc4a543adc3909025a9dd7/.circleci/config.yml#L80-L166

    That might be over-complicated for your use case ... the basic idea is that you copy the coverage.json file generated by each test run to a unique file name (coverage.json is saved in your project's root directory). Then use a cli utility called istanbul-combine-updated to merge the jsons in a final step.

    https://www.npmjs.com/package/istanbul-combine-updated?activeTab=readme

    jo-es
    @jo-es
    thanks! 🙏 I'm going to try that.
    julianlen
    @julianlen

    You should be able to resolve by setting disableConfirmationListener: true in whatever network you use to run your tests.
    And you can tell solidity-coverage to use a user-defined network via the cli with --network <network-name>

    Hi everyone! Regarding this answer, I'm trying to run solidity-coverage over RSK. So I run a node in regtest (a local network), and then npx truffle run coverage --network rsk but it throws:

    Error: Port 4444 is already in use.

    What am I doing wrong?

    cgewecke
    @cgewecke
    @julianlen solidity-coverage doesn't connect to arbitrary nodes ... it only works with ganache and HardhatEVM. It needs to hook into their JS evms to track the execution path of your code. I think you're seeing that error because the tool is trying to launch a ganache server instance on the port specified by your RSK network.