Skip to content

Commit

Permalink
fix: adapt to new forge-std Vm to remove warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
vdrg committed Sep 1, 2023
1 parent 6f6d9be commit e83ebd4
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/_modules/Json.sol
Original file line number Diff line number Diff line change
Expand Up @@ -48,111 +48,111 @@ library json {
/// @param jsonStr The json string.
/// @param key The key from the `jsonStr` to parse.
/// @return The uint256 value.
function getUint(string memory jsonStr, string memory key) internal returns (uint256) {
function getUint(string memory jsonStr, string memory key) internal pure returns (uint256) {
return vulcan.hevm.parseJsonUint(jsonStr, key);
}

/// @dev Parses the value of the `key` contained on `jsonStr` as uint256[].
/// @param jsonStr The json string.
/// @param key The key from the `jsonStr` to parse.
/// @return The uint256[] value.
function getUintArray(string memory jsonStr, string memory key) internal returns (uint256[] memory) {
function getUintArray(string memory jsonStr, string memory key) internal pure returns (uint256[] memory) {
return vulcan.hevm.parseJsonUintArray(jsonStr, key);
}

/// @dev Parses the value of the `key` contained on `jsonStr` as int256.
/// @param jsonStr The json string.
/// @param key The key from the `jsonStr` to parse.
/// @return The int256 value.
function getInt(string memory jsonStr, string memory key) internal returns (int256) {
function getInt(string memory jsonStr, string memory key) internal pure returns (int256) {
return vulcan.hevm.parseJsonInt(jsonStr, key);
}

/// @dev Parses the value of the `key` contained on `jsonStr` as int256[].
/// @param jsonStr The json string.
/// @param key The key from the `jsonStr` to parse.
/// @return The int256[] value.
function getIntArray(string memory jsonStr, string memory key) internal returns (int256[] memory) {
function getIntArray(string memory jsonStr, string memory key) internal pure returns (int256[] memory) {
return vulcan.hevm.parseJsonIntArray(jsonStr, key);
}

/// @dev Parses the value of the `key` contained on `jsonStr` as bool.
/// @param jsonStr The json string.
/// @param key The key from the `jsonStr` to parse.
/// @return The bool value.
function getBool(string memory jsonStr, string memory key) internal returns (bool) {
function getBool(string memory jsonStr, string memory key) internal pure returns (bool) {
return vulcan.hevm.parseJsonBool(jsonStr, key);
}

/// @dev Parses the value of the `key` contained on `jsonStr` as bool[].
/// @param jsonStr The json string.
/// @param key The key from the `jsonStr` to parse.
/// @return The bool[] value.
function getBoolArray(string memory jsonStr, string memory key) internal returns (bool[] memory) {
function getBoolArray(string memory jsonStr, string memory key) internal pure returns (bool[] memory) {
return vulcan.hevm.parseJsonBoolArray(jsonStr, key);
}

/// @dev Parses the value of the `key` contained on `jsonStr` as address.
/// @param jsonStr The json string.
/// @param key The key from the `jsonStr` to parse.
/// @return The address value.
function getAddress(string memory jsonStr, string memory key) internal returns (address) {
function getAddress(string memory jsonStr, string memory key) internal pure returns (address) {
return vulcan.hevm.parseJsonAddress(jsonStr, key);
}

/// @dev Parses the value of the `key` contained on `jsonStr` as address.
/// @param jsonStr The json string.
/// @param key The key from the `jsonStr` to parse.
/// @return The address value.
function getAddressArray(string memory jsonStr, string memory key) internal returns (address[] memory) {
function getAddressArray(string memory jsonStr, string memory key) internal pure returns (address[] memory) {
return vulcan.hevm.parseJsonAddressArray(jsonStr, key);
}

/// @dev Parses the value of the `key` contained on `jsonStr` as string.
/// @param jsonStr The json string.
/// @param key The key from the `jsonStr` to parse.
/// @return The string value.
function getString(string memory jsonStr, string memory key) internal returns (string memory) {
function getString(string memory jsonStr, string memory key) internal pure returns (string memory) {
return vulcan.hevm.parseJsonString(jsonStr, key);
}

/// @dev Parses the value of the `key` contained on `jsonStr` as string[].
/// @param jsonStr The json string.
/// @param key The key from the `jsonStr` to parse.
/// @return The string[] value.
function getStringArray(string memory jsonStr, string memory key) internal returns (string[] memory) {
function getStringArray(string memory jsonStr, string memory key) internal pure returns (string[] memory) {
return vulcan.hevm.parseJsonStringArray(jsonStr, key);
}

/// @dev Parses the value of the `key` contained on `jsonStr` as bytes.
/// @param jsonStr The json string.
/// @param key The key from the `jsonStr` to parse.
/// @return The bytes value.
function getBytes(string memory jsonStr, string memory key) internal returns (bytes memory) {
function getBytes(string memory jsonStr, string memory key) internal pure returns (bytes memory) {
return vulcan.hevm.parseJsonBytes(jsonStr, key);
}

/// @dev Parses the value of the `key` contained on `jsonStr` as bytes[].
/// @param jsonStr The json string.
/// @param key The key from the `jsonStr` to parse.
/// @return The bytes[] value.
function getBytesArray(string memory jsonStr, string memory key) internal returns (bytes[] memory) {
function getBytesArray(string memory jsonStr, string memory key) internal pure returns (bytes[] memory) {
return vulcan.hevm.parseJsonBytesArray(jsonStr, key);
}

/// @dev Parses the value of the `key` contained on `jsonStr` as bytes32.
/// @param jsonStr The json string.
/// @param key The key from the `jsonStr` to parse.
/// @return The bytes32 value.
function getBytes32(string memory jsonStr, string memory key) internal returns (bytes32) {
function getBytes32(string memory jsonStr, string memory key) internal pure returns (bytes32) {
return vulcan.hevm.parseJsonBytes32(jsonStr, key);
}

/// @dev Parses the value of the `key` contained on `jsonStr` as bytes32[].
/// @param jsonStr The json string.
/// @param key The key from the `jsonStr` to parse.
/// @return The bytes32[] value.
function getBytes32Array(string memory jsonStr, string memory key) internal returns (bytes32[] memory) {
function getBytes32Array(string memory jsonStr, string memory key) internal pure returns (bytes32[] memory) {
return vulcan.hevm.parseJsonBytes32Array(jsonStr, key);
}

Expand Down

0 comments on commit e83ebd4

Please sign in to comment.