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

Add new hook and make temporary contracts directory configurable #664

Merged
merged 6 commits into from Sep 9, 2021

Conversation

rynobey
Copy link
Contributor

@rynobey rynobey commented Sep 9, 2021

This PR adds two small features:

  • A new hook that gets called right before compiling the instrumented source code (onPreCompile)
  • The ability to specify an alternative temporary directory to use for the instrumented source code

I have made an attempt to update the documentation and added the hook to the existing test - please let me know if I can add anything else to make the PR more complete.

update to latest upstream version
Update master with upstream
#3)

* Added onPreCompile hook

* Added configurable temporary contracts directory

* Added test for new onPreCompile hook

* Updated documentation
@codecov-commenter
Copy link

codecov-commenter commented Sep 9, 2021

Codecov Report

Merging #664 (8d5add2) into master (67b711d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #664   +/-   ##
=======================================
  Coverage   98.68%   98.69%           
=======================================
  Files          22       22           
  Lines         991      993    +2     
=======================================
+ Hits          978      980    +2     
  Misses         13       13           
Impacted Files Coverage Δ
lib/api.js 100.00% <100.00%> (ø)
plugins/resources/plugin.utils.js 97.64% <100.00%> (ø)
plugins/truffle.plugin.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 67b711d...8d5add2. Read the comment docs.

Copy link
Member

@cgewecke cgewecke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thanks so much!

Would it be possible to add docs for the hook and the new temp contracts directory option to the config options table in the

  • README.md
  • HARDHAT_README.md

A brief sentence about how the preCompile hook is useful would also be nice.

(That table is a bit painful to add to in markdown, sorry about this...)

Copy link
Member

@cgewecke cgewecke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic, thanks again.

(Will hopefully publish this weekend)

@cgewecke cgewecke merged commit cdab28c into sc-forks:master Sep 9, 2021
@rynobey
Copy link
Contributor Author

rynobey commented Jan 11, 2022

Hi @cgewecke, just wanted to follow up - I could be missing it but I don't see any new releases containing this work (yet)?

@cgewecke
Copy link
Member

Hi! I'm so sorry. I thought I had published this, thanks for the ping.

I'need to add some tests for #667 tomorrow and will merge and publish then.

@rynobey
Copy link
Contributor Author

rynobey commented Jan 12, 2022

Awesome :) Thanks!!

@cgewecke
Copy link
Member

This is now published in 0.7.18

@rynobey
Copy link
Contributor Author

rynobey commented Jan 18, 2022

Awesome!

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

Successfully merging this pull request may close these issues.

None yet

3 participants