Closed smol-ninja closed 3 months ago
IMO it would be better if we implement a function ourselves that replicates the changePrank
(i would name it differently)
I agree with you Andrei. On the name how about resetPrank
?
Do you like the name @andreivladbrg or want to suggest something else?
I agree with @andreivladbrg, let's go with the path of least resistance and re-implement changePrank
ourselves.
resetPrank
works!
The foundry cheatcode
changePrank
has been deprecated and will likely be removed in the future release.Replacing it with
vm.startPrank
seems like a straightforward solution but it has introduced a new requirement that the prank must have been applied atleast once before overriding. This has also been raised by @PaulRBerg in https://github.com/foundry-rs/foundry/issues/4942 but a shame that they decided to close it in favour of the suggestion to handle it using readCallers.Since we decided to update
forge-std
, the tests now throw a deprecation warning. There are two solutions I can think of:vm.startPrank
.changePrank
function ourselves which callsvm.stopPrank
followed byvm.startPrank
.Wdyt @PaulRBerg @andreivladbrg.
Related