Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird behavior with packages locked to a git commit #165

Closed
hickscorp opened this issue Dec 18, 2017 · 2 comments
Closed

Weird behavior with packages locked to a git commit #165

hickscorp opened this issue Dec 18, 2017 · 2 comments

Comments

@hickscorp
Copy link

hickscorp commented Dec 18, 2017

If in your package.json, you have something like this:

  "dependencies": {
    "zeppelin-solidity": "git+http://github.com/OpenZeppelin/zeppelin-solidity#ddcae6254ea4d15204f4830bd2580bce03423aec"
  },

And then if you configure solidity-coverage with something like this:

module.exports = {
  host: 'localhost',
  port: 8555,
  norpc: false,
  testCommand: 'yarn run truffle test --network coverage',
  copyPackages: ['zeppelin-solidity']
};

Then something very weird happens. The correct version of zeppelin is copied in the coverageEnv directory, until after the Instrumenting... steps are done, and then the package is reverted to the 1.4 version.

Eg:

If I cat node_modules/zeppelin-solidity/contracts/math/SafeMath.sol, I get the latest from their git repo. Each function is annotated internal pure.
However if I cat cat coverageEnv/node_modules/zeppelin-solidity/contracts/math/SafeMath.sol before the Instrumenting... steps, the file stays the same but if I do so just after the Instrumenting... steps, the file is reverted to their 1.4 branch version and the functions are incorrectly annotated internal.

What's going on?

@hickscorp hickscorp changed the title Failure to copy package if from a git source. Weird behavior with packages locked to a git commit Dec 18, 2017
@cgewecke
Copy link
Member

@hickscorp The removal of the pure modifier during the instrumentation step is intentional. See #146 for more on why this necessary. Agree this is weird but believe coverage is running the zeppelin version you intend, apart from the modifications it makes to contracts in order to execute successfully.

@hickscorp
Copy link
Author

hickscorp commented Dec 18, 2017

@cgewecke My bad indeed. A coincidence that I was updating a package that adds modifiers to functions, and I thought the version of the package was being reverted. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants