cgewecke / hardhat-gas-reporter

Gas Usage Analytics for Hardhat
MIT License
411 stars 57 forks source link

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

Closed web3dopamine closed 8 months ago

web3dopamine commented 1 year ago

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 commented 12 months ago

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 commented 11 months ago

·----------------------------------------|---------------------------|-------------|-----------------------------· | 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 commented 11 months ago

Hey ! I have same error

HarukiKondo commented 11 months ago

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

HarukiKondo commented 11 months ago

↑ It solved!!