Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(StdCheats): deprecate changePrank #434

Merged
merged 2 commits into from
Aug 14, 2023

Conversation

Evalir
Copy link
Member

@Evalir Evalir commented Aug 14, 2023

Leftover work from foundry-rs/foundry#4826 (comment) — deprecates changePrank before we delete it completely.

@@ -692,6 +693,7 @@ abstract contract StdCheats is StdCheatsSafe {
}

function changePrank(address msgSender) internal virtual {
console2.log("changePrank is deprecated. Please use vm.startPrank instead.");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of importing console2 do you mind doing something this? It helps reduce compilation times in some cases, and compilation times are becoming a bottleneck for a lot of users :)

forge-std/src/StdUtils.sol

Lines 187 to 197 in c70ef65

// Used to prevent the compilation of console, which shortens the compilation time when console is not used elsewhere.
function console2_log(string memory p0, uint256 p1) private view {
(bool status,) = address(CONSOLE2_ADDRESS).staticcall(abi.encodeWithSignature("log(string,uint256)", p0, p1));
status;
}
function console2_log(string memory p0, string memory p1) private view {
(bool status,) = address(CONSOLE2_ADDRESS).staticcall(abi.encodeWithSignature("log(string,string)", p0, p1));
status;
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for sure! done in e6fae92

@Evalir Evalir requested a review from mds1 August 14, 2023 23:50
Copy link
Collaborator

@mds1 mds1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mds1 mds1 merged commit 1cefc0e into foundry-rs:master Aug 14, 2023
3 checks passed
@Evalir Evalir deleted the evalir/deprecate-changeprank branch August 14, 2023 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants