foundry icon indicating copy to clipboard operation
foundry copied to clipboard

feat: `vm.depth()` cheatcode to return the depth of the current invariant run

Open mds1 opened this issue 3 years ago • 0 comments

Component

Forge

Describe the feature you would like

Two enables two use cases that I can't think of good workarounds for:

  1. Logging all sequences for all runs to a file with vm.writeLine()
  2. Skipping checks on depth=0, i.e. skip the "invariant must hold at the start" check. The use case here is testing that a variable monotonically increases and before any calls are made, since at the start "last value" and "current value" are the same.

Additional context

No response

mds1 avatar Aug 28 '22 15:08 mds1