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

hardhat-gas-reporter doesnt work on npx hardhat test #150

Closed
web3dopamine opened this issue Mar 2, 2023 · 5 comments
Closed

hardhat-gas-reporter doesnt work on npx hardhat test #150

web3dopamine opened this issue Mar 2, 2023 · 5 comments

Comments

@web3dopamine
Copy link

web3dopamine commented Mar 2, 2023

I tried running hardhat-gas-reporter in hardhat default template it doesn't work with npx hardhat test, we have to use flag REPORT_GAS=true then only it will run contract which has test script written.

image
image

NFT.sol contract report is not generated (at all) in none of the cases.

image

tried on node version 16 & 17

@Madeindreams
Copy link

Madeindreams commented Oct 23, 2023

In my case, even when using the flag, it does not report anything at all. All is see is the header of the table.

using hardhat 2.18.2
hardhat-gas-reporter 1.0.9
node 16.17.1
solidity 0.8.21

image

@HarukiKondo
Copy link

·----------------------------------------|---------------------------|-------------|-----------------------------·
| Solc version: 0.8.20 · Optimizer enabled: true · Runs: 200 · Block limit: 30000000 gas │
·········································|···························|·············|······························
| Methods │
···················|·····················|·············|·············|·············|···············|··············
| Contract · Method · Min · Max · Avg · # calls · jpy (avg) │
···················|·····················|·············|·············|·············|···············|··············
| MockERC1155NFT · burn · - · - · 26033 · 1 · - │
···················|·····················|·············|·············|·············|···············|··············
| MockERC1155NFT · burnBatch · 32316 · 32336 · 32326 · 3 · - │
···················|·····················|·············|·············|·············|···············|··············
| MockERC1155NFT · mint · - · - · 53347 · 7 · - │
···················|·····················|·············|·············|·············|···············|··············
| MockERC1155NFT · mintBatch · 79847 · 79871 · 79859 · 9 · - │
···················|·····················|·············|·············|·············|···············|··············
| MockERC1155NFT · safeTransferFrom · 57103 · 57115 · 57107 · 3 · - │

@HarukiKondo
Copy link

Hey ! I have same error

@HarukiKondo
Copy link

my project's library versions
"ethers": "6.1.0",
"hardhat": "2.18.3",
"hardhat-gas-reporter": "^1.0.9",

@HarukiKondo
Copy link

↑ It solved!!

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

4 participants