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

The --no-compile flag and gas report completeness #104

Open
davidtperk opened this issue Mar 6, 2022 · 3 comments
Open

The --no-compile flag and gas report completeness #104

davidtperk opened this issue Mar 6, 2022 · 3 comments

Comments

@davidtperk
Copy link

hardhat-gas-reporter produces complete gas reports for hh test --no-compile but excludes my contracts for hh test run without the --no-compile flag. Unable to pinpoint a root cause and don't have a reproducible example yet, but wanted to check if there are known issues why compilation might cause hardhat-gas-reporter to miss contract calls. Other plugins in use that may be relevant include hardhat-abi-exporter, hardhat-solpp, and hardhat-dependency-compiler.

@cgewecke
Copy link
Owner

cgewecke commented Mar 6, 2022

excludes my contracts for hh test run without the --no-compile flag

Oh interesting. Do you mean you only get a partial report and newly compiled contracts are missing?

The plugin loads compilation artifacts as part of a mocha configuration step (I'd guess this must happen before auto-compilation). And it uses hre.artifacts supplied to it by an over-ridden subtask: TASK_TEST_RUN_MOCHA_TESTS

(Just leaving a note for myself that this is where we bind that for consumption in the mocha reporter at eth-gas-reporter).

options.getContracts = getContracts.bind(null, hre.artifacts, options.excludeContracts);

@davidtperk
Copy link
Author

davidtperk commented Mar 6, 2022

Do you mean you only get a partial report and newly compiled contracts are missing?

Precisely. hh compile && hh test --no-compile works, but not hh test.

console.log(hre.artifacts._validArtifacts) just above the line you linked to (but in index.js) returns []with --no-compile and a long array of artifacts without --no-compile.

@cgewecke
Copy link
Owner

cgewecke commented Mar 6, 2022

Ah! Thanks for reporting and looking at that. Not sure what to do about this off the top of my head....

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