-
Notifications
You must be signed in to change notification settings - Fork 71
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
add ffi
cheatcode
#185
add ffi
cheatcode
#185
Conversation
I am aware that both |
Great contribution! To help us review, could you please add tests for this cheatcode? Also, could you disable the ffi cheatcode by default (for security reasons), and add an option to enable it? Thank you! |
@daejunpark Please let me know if the tests I added are enough. I wanted to add one to test execution failure, but there is no |
looks good, thanks @luksgrin! I'll make a couple small changes to have CI pass directly to the branch if you don't mind |
No problem! Thanks😄 |
Awesome! Currently, you can use the expected json exitcode to test the failure cases. Please feel free to add negative tests if you already have something in mind. |
I had one but I removed it! I will write it again so that we can add it 😃 |
Head branch was pushed to by a user without write access
Done! |
Thank you! Let me reorg the pytest tests to exclude the ffi tests on windows. |
@luksgrin let me go ahead and merge this for now, as it's been open for quite some time. we can create a separate pr if the semantics of ffi needs to be improved. thanks for your contribution! |
Tysm for merging! I believe it is a perfect choice to imitate foundry's default behavior :) |
This PR contains the implementation of Foundry's
function ffi(string[] calldata) external returns (bytes memory);
cheatcode with some helper functions and some code refactoring. Seeffi
's documentation here.Dependencies added
subprocess
module