defi-wonderland / smock

The Solidity mocking library
MIT License
319 stars 40 forks source link

Add support to fake gas consumption on mocked function calls #119

Open wei3erHase opened 2 years ago

wei3erHase commented 2 years ago

When faking a return fake.function.returns(1) allow the developer to explicit the gas consumption that he wants that return to use fake.function.returns(1, { gasUsed: 1e6 })

With this feature, a developer can add all the gas settings for the fakes (transfer uses 20k, approve uses 10k, …) and get a more realistic outcome in the gas test for each function.

It should allow to explicit gasUsed for a particular call (fake.function.returnsAtCall(… { gasUsed: 1e6}).