PatrickAlphaC / hardhat-fund-me-fcc

82 stars 183 forks source link

Gasreport: Missing min/max gas usage for some/all functions #110

Closed SebastianKuehl closed 1 year ago

SebastianKuehl commented 1 year ago

Hi everyone! I'll make it quick. I cloned this repo, enabled the gas reporter and ran the tests. For some reason the gas reporter only gives min/max gas usage in its report for the "fund" function (see picture below), but not the others. I have this issue in other projects, too, where the gas reporter doesn't add min/max usages to the report if any.

My steps:

  1. cloned the typescript branch
  2. added my .env with the same namings as in .env.example
  3. Uncommented coinmarketcap in the hardhat.config.js (line 54)
  4. ran "yarn install"
  5. ran "yarn hardhat test"

The test came out fine, but min/max gas usages for the functions "cheaperWithdraw" and "withdraw" are missing. In my other repos no function has a min/max reporting. Thus, I suspect that it must be something on my computer maybe? Or is it network (router) related maybe? My argument is, that Patrick uses this repo too and he gets these values! Any ideas?

image
0xSpraggins commented 1 year ago

I am facing this issue currently as well. Will let you know if I figure out what is going on.

PatrickAlphaC commented 1 year ago

This isn't an issue!

When running the gas reporter, it takes a look at the different runs of each function. If the function only runs once in your tests though, it would have enough runs to give you a min/max!

Try running the functions in other tests and you'll see min/max runs.