You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this should be addressed in solmate tests too, thing is that there are cases that do not fail test (and should as indicated in test name testFailTransferFromNotAuthorized), like using counterexample above in an unit test foundry-rs/foundry#7531 (comment)
function testFailTransferFromNotAuthorized_counterexample() public {
address sender =address(0x7FA9385bE102ac3EAc297483Dd6233D62b3e1496);
address receiver =address(0x000000000000000000000000000000000000089a);
uint256 id =31;
uint256 amount =3642;
amount =bound(amount, 1, type(uint256).max);
token.mint(sender, id, amount);
token.transferFrom(sender, receiver, id, amount);
}
failure can be also reproduced by placing a failures file in cache/fuzz/ dir with following content
# Seeds for failure cases proptest has generated in the past. It is
# automatically read and these particular cases re-run before any
# novel cases are generated.
#
# It is recommended to check this file in to source control so that
# everyone who runs the test benefits from these saved cases.
cc 22e4b1983d70b8b5cd9d0de968c12d8781238594f65b39328f157cdcadca620a # shrinks to 0xc5b21e8f0000000000000000000000007fa9385be102ac3eac297483dd6233d62b3e14960000000000000000000000000000000000000000000000000000000000000899000000000000000000000000000000000000000000000000000000000000001f0000000000000000000000000000000000000000000000000000000000000e3c
I opened this issue earlier in foundry-rs regarding an issue running solmate's tests in the benchmarks
foundry-rs/foundry#7531
yields failure because test passes
whereas if rename test to
testTransferFromNotAuthorized_counterexample
it is passingTo prevent against panics when running forge benches probably here we should not assume execution is always success but just execute
https://github.com/foundry-rs/foundry/blob/d94e3c631e2da7756af46c70f8f58b75563b7013/crates/forge/benches/test.rs#L17-L19
The
cache/fuzz/failures
cannot be found because bench clones and runs project in a temp dir which is wiped out after executionOriginally posted by @grandizzy in foundry-rs/foundry#7531 (comment)
The text was updated successfully, but these errors were encountered: