cgewecke / eth-gas-reporter

Gas usage per unit test. Average gas usage per method. A mocha reporter.
MIT License
603 stars 94 forks source link

enabled but does not report anything #246

Closed nazariyv closed 2 years ago

nazariyv commented 3 years ago
gas-reporter

what might be the cause of this? thank you

cgewecke commented 3 years ago

@nazariyv It's impossible to know without reproduction steps. Can you create an example repo which results in the same output and open it on github?

cgewecke commented 3 years ago

@nazariyv Have you used Paul Bergs solidity-template for your project?

If so, it has a bug in the gasReporter config that results in no data being produced.

This line in the config, where excludeContracts has an empty string should be commented out (or given a non-empty string if you want to skip something.)

nazariyv commented 3 years ago

I have used this:

https://github.com/wighawag/template-ethereum-contracts

This is my config:

  paths: {
    sources: 'src',
  },
  gasReporter: {
    currency: 'USD',
    gasPrice: 200,
    coinmarketcap: process.env.COINMARKETCAP_API_KEY,
    maxMethodDiff: 10,
  }
cgewecke commented 3 years ago

@nazariyv When I clone that template, install and run yarn gas, per the instructions I see:

Screen Shot 2021-04-02 at 2 17 19 PM

jfrank-summit commented 3 years ago

I am also having this issue after adding gas-reporter to an existing project. were you able to get it resolved @nazariyv ?

Magicking commented 2 years ago

Having the same problem here, using the specified template above, after a bit of investigation, it seems that the EGRDataCollectionProvider provider is not called upon request, the main difference with the used example is the usage of certain proxies, in the process of writing a minimal test case

cgewecke commented 2 years ago

Closing, please just ping if this is still an issue.

Magicking commented 2 years ago

Sorry I have not updated here, got busy elsewhere, long story short, wrote 3 different tests cases that I can't share unfortunately but I did not manage to find the minimum, my best guess as of today is an incomparability between hardhat community plugins!

cgewecke commented 2 years ago

@Magicking Oh interesting. Are you using @openzeppelin/hardhat-upgrades by chance?

There is a similar looking issue to this one recently opened at hardhat-gas-reporter 86 (cause is still unknown there too unfortunately)