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

feat(cheatcodes): string format #9402

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

leovct
Copy link
Contributor

@leovct leovct commented Nov 25, 2024

Motivation

Closes #5002

Implement format cheatcode to format strings with specifiers like %s and %d, similar to console logging.

This is just a first iteration, I'd like to see if it's aligned with what's needed.

Solution

Most of the logic reuses foundry_common::fmt::console_format to avoid code duplication.

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

these look good, what's missing @leovct ?

@mattsse mattsse marked this pull request as ready for review November 27, 2024 10:53
@zerosnacks
Copy link
Member

zerosnacks commented Nov 27, 2024

these look good, what's missing @leovct ?

there is a concern about the bloat on Vm.sol if expanded to all cases for completeness as it should effectively mirror the console implementation, see: #5002 (comment)

Re-marking as draft to prevent an accidental partial merge

@zerosnacks zerosnacks marked this pull request as draft November 27, 2024 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Feature request: String.format with specifiers
3 participants