dapphub / dapptools

Dapp, Seth, Hevm, and more
https://dapp.tools
2.07k stars 325 forks source link

Gas snapshotting #761

Open transmissions11 opened 2 years ago

transmissions11 commented 2 years ago

Writing this down so I don't forget. Could implement this hardhat gas snapshotting pattern pretty easily by:

transmissions11 commented 2 years ago

ideally don't run non-concrete tests (tests prefixed with prove/invariant and standard test prefixed functions with arguments) during dapp snapshot or else things could take a while

jennypollack commented 2 years ago

i feel like it could make sense to add a flag for doing a "quick" run in the general case, that skips the above specified longer running tests, that we could then leverage here...wdyt

transmissions11 commented 2 years ago

would be epic.

this is some wishlist shit but would love an env var like DAPP_TEST_MODE that could be set to 1 or 2 (0/unset would just trigger the current behavior). In mode 1 it runs all prove tests as fuzz tests for people to quickly run their whole suite and make sure there's no low hanging fruit. In mode 2 it would do what we discussed above and ignore all non-concrete tests entirely.