From 2ac3040c12ac8d14a8ae5bd183b42a664893ba4c Mon Sep 17 00:00:00 2001 From: Paul Razvan Berg Date: Tue, 26 Sep 2023 12:29:40 +0300 Subject: [PATCH] feat: add "serializeJson" refactor: order "serialize" cheats alphabetically --- src/Vm.sol | 60 +++++++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/src/Vm.sol b/src/Vm.sol index 2583996..7422a77 100644 --- a/src/Vm.sol +++ b/src/Vm.sol @@ -430,76 +430,80 @@ interface VmSafe { /// @dev Returns all rpc urls and their aliases as structs. function rpcUrlStructs() external view returns (Rpc[] memory urls); - /// @dev Serializes a key and value to a JSON object stored in-memory that can be later written to a file. - /// It returns the stringified version of the specific JSON file up to that moment. - function serializeBool( + function serializeAddress( string calldata objectKey, string calldata valueKey, - bool value + address value ) external returns (string memory json); - function serializeUint( + function serializeAddress( string calldata objectKey, string calldata valueKey, - uint256 value + address[] calldata values ) external returns (string memory json); - function serializeInt( + /// @dev Serializes a key and value to a JSON object stored in-memory that can be later written to a file. + /// It returns the stringified version of the specific JSON file up to that moment. + function serializeBool( string calldata objectKey, string calldata valueKey, - int256 value + bool value ) external returns (string memory json); - function serializeAddress( + function serializeBool( string calldata objectKey, string calldata valueKey, - address value + bool[] calldata values ) external returns (string memory json); - function serializeBytes32( + function serializeBytes( string calldata objectKey, string calldata valueKey, - bytes32 value + bytes calldata value ) external returns (string memory json); - function serializeString( + function serializeBytes( string calldata objectKey, string calldata valueKey, - string calldata value + bytes[] calldata values ) external returns (string memory json); - function serializeBytes( + function serializeBytes32( string calldata objectKey, string calldata valueKey, - bytes calldata value + bytes32 value ) external returns (string memory json); - function serializeBool( + function serializeBytes32( string calldata objectKey, string calldata valueKey, - bool[] calldata values + bytes32[] calldata values ) external returns (string memory json); - function serializeUint( + /// @dev Serialize a key and value to a JSON object stored in-memory that can be later written to a file + /// It returns the stringified version of the specific JSON file up to that moment. + function serializeJson(string calldata objectKey, string calldata value) external returns (string memory json); + + function serializeInt( string calldata objectKey, string calldata valueKey, - uint256[] calldata values + int256 value ) external returns (string memory json); @@ -512,34 +516,34 @@ interface VmSafe { external returns (string memory json); - function serializeAddress( + function serializeString( string calldata objectKey, string calldata valueKey, - address[] calldata values + string calldata value ) external returns (string memory json); - function serializeBytes32( + function serializeString( string calldata objectKey, string calldata valueKey, - bytes32[] calldata values + string[] calldata values ) external returns (string memory json); - function serializeString( + function serializeUint( string calldata objectKey, string calldata valueKey, - string[] calldata values + uint256 value ) external returns (string memory json); - function serializeBytes( + function serializeUint( string calldata objectKey, string calldata valueKey, - bytes[] calldata values + uint256[] calldata values ) external returns (string memory json);