IrrigationProtocol / irrigation-contracts-diamond

MIT License
3 stars 1 forks source link

Generate Gas Costs from tests into JSON file #54

Closed Super-Genius closed 1 year ago

Super-Genius commented 1 year ago

Generate the gas costs from testing using https://www.npmjs.com/package/@mycrypto/gas-estimation

In tests, call estimate gas, and any failures should add the function to a gaslimits.json file and use the generated gas costs to add to the file and checked into the irrigation-dapp repo.

This way we can load the gaslimits.json file into the front and and use some percentage like 20%.

gasLimits.json

 "gasLimits": [
  { "placeBid": "200000" },
  { "buyNow": "240000" }
 ]

We then can load the gasLimits.json file into irrigation-dapp front end code and get rid of the Exceeds Gas Limit errors or unable to calculate gas.

ruymaster commented 1 year ago

Fixed