cgewecke / hardhat-gas-reporter

Gas Usage Analytics for Hardhat
MIT License
409 stars 56 forks source link

#157 Add viem support and related tests #156

Closed muhammetaliakbay closed 7 months ago

muhammetaliakbay commented 10 months ago

Related issue: https://github.com/cgewecke/hardhat-gas-reporter/issues/157

This PR

gionn commented 8 months ago

@cgewecke any feedback on this?

cgewecke commented 8 months ago

@muhammetaliakbay @gionn Thanks so much for this and apologies for taking so long to review.

Could someone link to the relevant code at viem or hardhat where the freezing described below happens?

Injecting the modified provider in TASK_TEST_RUN_MOCHA_TESTS sub task is too late as viem reads and freezes the provider instance on the module load

I'm a little worried about configuring the provider for gas logging in an extendEnvironment hook because AFAIK.it will execute for every task hardhat runs. It might come into conflict with other plugins and is difficult to enable/disable conditionally.

That said there is also a new extendProvider hook available in more recent HH versions which seems to be designed for this kind of application. Does using that have same freezing problem?

(Will pull this PR down this week and take a closer look to see if there are any other issues...thanks for all the work you've already put into this).

transmental commented 8 months ago

pls merge this

cgewecke commented 7 months ago

This work is being continued in #167 (@muhammetaliakbay's authorship is preserved there) ... am just trying to understand everything in the PR and seeing if a less extensive set of changes if possible to get viem support working. Leaving this open for now.