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

Support HardHat #541

Closed
5 tasks
cgewecke opened this issue Oct 14, 2020 · 6 comments
Closed
5 tasks

Support HardHat #541

cgewecke opened this issue Oct 14, 2020 · 6 comments

Comments

@cgewecke
Copy link
Member

cgewecke commented Oct 14, 2020

@PaulRBerg
Copy link
Contributor

Looking forward to this!

@cgewecke
Copy link
Member Author

0.7.12

See the new Hardhat README for installation instructions, etc.

By default coverage now runs on the HardhatEVM / network and requires no additional config or ganache provider setup. Also about 2X faster.

Please just lmk if you run into any issues with this.

gtaschuk added a commit to balancer/balancer-v2-monorepo that referenced this issue Nov 17, 2020
@PaulRBerg
Copy link
Contributor

Amazing! I upgraded to 0.7.12 in my [solidity-template][1] and it works like a charm with Hardhat. Thanks @cgewecke!

https://github.com/PaulRBerg/solidity-template

@shalzz
Copy link

shalzz commented Nov 18, 2020

Hi,
This does work great unless you have set a different path for artifacts in hardhat.config.{js,ts}.

For example in my repo I have

  paths: {
    cache: "./build/cache",
    artifacts: "./build/artifacts",
  },

So with still the tests fail unless I run with hardhat coverage --temp build/artifacts since I'm also using the hardhat-typechain plugin which reads from the artifacts path.

I think the right thing to do here is for the plugin to have the artifacts be stored in the paths.artifacts path instead of the hardcoded .coverage_artifacts path

This is an example repo with this config: https://github.com/unipeer/unipeer

@cgewecke
Copy link
Member Author

Hi @shalzz, thanks for reporting.

Yes, I think at a minimum the README needs to highlight this option and discuss how to use w/ typechain or other plugins that also rely on the paths.artifacts value.

The difficulty with storing coverage artifacts in the default location is that they are "corrupted" by the instrumentation the tool adds to the solidity code. And it's possible people rely on the artifacts folder being preserved across commands and would be upset when coverage automatically deletes it.

Additionally, there is a bug discovered yesterday in the way paths.artifacts is set/read (#573) which I've cross-reported at hardhat 1030. Am waiting for advice about how to proceed there...

@shalzz
Copy link

shalzz commented Nov 19, 2020

Hi @cgewecke

Yes that makes sense, I think the if #573 is fixed it should also address this issue, since then typechain can then just read the instrumented artifacts from the temp folder set by this plugin.

In any case thanks a lot for the plugin.

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

No branches or pull requests

3 participants