-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(cheatcodes
): add delegatecall
to prank
ing
#8863
Conversation
crates/cheatcodes/src/inspector.rs
Outdated
@@ -833,6 +833,19 @@ impl Cheatcodes { | |||
|
|||
// Apply our prank | |||
if let Some(prank) = &self.prank { | |||
// Apply delegate call. call.caller will not equal prank.prank_caller |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @zerosnacks, my understanding is a little fuzzy here. It seems in the case of a delegate call that call.caller == prank.prank_caller
will not be true. Is it suitable to have this here? Ty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @DaniPopes would you have more context on this?
a7e8123
to
325c218
Compare
8a65994
to
d964aad
Compare
cheatcodes
): add delegatecall
to prank
ingcheatcodes
): add delegatecall
to prank
ing
Hi @EdwardJES thanks for your PR - my apologies that it has taken a while to respond |
cheatcodes
): add delegatecall
to prank
ingcheatcodes
): add delegatecall
to prank
ing
gentle bump on this @zerosnacks, @DaniPopes . Thank you 🙏 |
@EdwardJES is there anything waiting from us to unblock the PR or can we start the review? thank you! |
@grandizzy all good to go, thanks! |
bac569b
to
3632509
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, thank you! I rebased and added a negative test (EOA prank), have one comment re handling ExtDelegateCall
as well
@grandizzy, thank you for the review and help in rebasing. Added your suggestion 🙏. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thank you! pending other reviews before merging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Motivation
Closes #824. Currently there is no easy way to test delegate calls using foundry tests.
Solution
delegate_call
flag to the prank.