foundry icon indicating copy to clipboard operation
foundry copied to clipboard

feat(forge): filter through artifacts on invariant testing

Open joshieDo opened this issue 3 years ago • 0 comments

Motivation

The ability to filter addresses/functions through their artifacts, instead of just their addresses.

Solution

function targetArtifacts() returns (string[] memory) // ["Contract1","src/Contract2.sol:Contract2"]
function excludeArtifacts() returns (string[] memory) // ["Contract1","src/Contract2.sol:Contract2"]
function targetArtifactSelectors() returns (string, bytes4[])[] memory) // [("Contract1", [Contract1.hello.selector])]

This touches both the addresses coming from the setUp(), as well as any contract generated through a run (testdata/fuzz/invariant/targetAbi/TargetArtifactSelectors2.t.sol).

Priorities when clashing:

targetSelectors | targetArtifactSelectors > excludeContracts | excludeArtifacts > targetContracts | targetArtifacts

joshieDo avatar Aug 05 '22 18:08 joshieDo

lgtm, merge wen ready

mattsse avatar Aug 10 '22 16:08 mattsse

great, just need to fix some issue introduced on 13813f4

joshieDo avatar Aug 10 '22 17:08 joshieDo