-
Notifications
You must be signed in to change notification settings - Fork 13
Implement toString(...) cheatcodes #1096
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
Implement toString(...) cheatcodes #1096
Conversation
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.
Pull Request Overview
This PR implements Foundry's toString cheatcode functions, enabling conversion of various data types (address, bytes, bool, bytes32, uint256, int256) to their string representations. These cheatcodes are frequently used in tests and are needed for Simbolik.
Key Changes:
- Implements six
toStringvariants with appropriate conversion logic including EIP-55 checksum for addresses - Moves selector definitions from unimplemented to implemented section
- Removes corresponding tests from the skip list to enable verification
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/kontrol/kdist/cheatcodes.md | Adds implementation rules for all toString variants with helper functions for address checksumming and hex conversion; moves selectors to implemented section |
| src/tests/integration/test-data/foundry-prove-skip | Removes six ToStringTest entries from skip list to enable test execution |
| src/tests/integration/test-data/foundry/test/ToStringTest.t.sol | Updates test data from zero value to meaningful hex value for better validation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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! I just left a couple of suggestions removing empty lines for consistency. Did you get a chance to run these cheatcodes with symbolic arguments? It might be good to add a test for it, at least for some arg types, to make sure the execution doesn't crash.
Co-authored-by: Palina <[email protected]>
Co-authored-by: Palina <[email protected]>
Co-authored-by: Palina <[email protected]>
This PR adds implementations for Foundry's
toStringcheat codes. They're frequently used in tests and needed for Simbolik.