Thanks to visit codestin.com
Credit goes to github.com

Skip to content

support for vm.toString() #565

@daejunpark

Description

@daejunpark

motivation:

the bound cheatcode for signed integers uses vm.toString() when printing the result value. e.g., this test failed due to that.

spec:

https://github.com/foundry-rs/forge-std/blob/60acb7aaadcce2d68e52986a0a66fe79f07d138f/src/Vm.sol#L1236-L1252

    /// Converts the given value to a `string`.
    function toString(address value) external pure returns (string memory stringifiedValue);

    /// Converts the given value to a `string`.
    function toString(bytes calldata value) external pure returns (string memory stringifiedValue);

    /// Converts the given value to a `string`.
    function toString(bytes32 value) external pure returns (string memory stringifiedValue);

    /// Converts the given value to a `string`.
    function toString(bool value) external pure returns (string memory stringifiedValue);

    /// Converts the given value to a `string`.
    function toString(uint256 value) external pure returns (string memory stringifiedValue);

    /// Converts the given value to a `string`.
    function toString(int256 value) external pure returns (string memory stringifiedValue);

the semantics of toString(bytes) isn't clear, but the others should be straightforward.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions