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

Gas is not reported for non-default Signers when using hardhat/ethers #235

Closed nmclrn closed 3 years ago

nmclrn commented 3 years ago

I am using hardhat with ethers and waffle and hardhat-gas-reporter. It's generally awesome! 👏 👏

If I have a test that calls: await myContract.connect(someNonDefaultSigningAccount).myFunction(someParams) I see no gas usage reported for this function call.

The problem here seems to be related to calling connect to use a different Signer, because calling await myContract.myFunction(someParams) (without the .connect()) reports gas just fine.

cgewecke commented 3 years ago

Hi @nmclrn

To double-check, are you using the latest version (1.0.4)? (It was published last week).

A similar issue was fixed in that release via hardhat-gas-reporter 54.

nmclrn commented 3 years ago

Upgrading to 1.0.4 fixes this - thank you so much for the super-quick reply!