Skip to content

Commit

Permalink
Merge pull request #34 from PaulRBerg/feat/add-serialize-json
Browse files Browse the repository at this point in the history
feat: add "serializeJson"
  • Loading branch information
PaulRBerg authored Sep 26, 2023
2 parents 7e120b3 + 2ac3040 commit 43c6bfb
Showing 1 changed file with 32 additions and 28 deletions.
60 changes: 32 additions & 28 deletions src/Vm.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 43c6bfb

Please sign in to comment.