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

fix: ds-test imports + compiler warnings #210

Merged
merged 2 commits into from
Nov 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/StdAssertions.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.9.0;

import "../lib/ds-test/src/test.sol";
import "ds-test/test.sol";
import "./StdMath.sol";

abstract contract StdAssertions is DSTest {
Expand Down
30 changes: 15 additions & 15 deletions src/StdJson.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,63 +9,63 @@ import "./Vm.sol";
library stdJson {
VmSafe private constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code")))));

function parseRaw(string memory json, string memory key) internal returns (bytes memory) {
function parseRaw(string memory json, string memory key) internal pure returns (bytes memory) {
return vm.parseJson(json, key);
}

function readUint(string memory json, string memory key) internal returns (uint256) {
function readUint(string memory json, string memory key) internal pure returns (uint256) {
return abi.decode(vm.parseJson(json, key), (uint256));
}

function readUintArray(string memory json, string memory key) internal returns (uint256[] memory) {
function readUintArray(string memory json, string memory key) internal pure returns (uint256[] memory) {
return abi.decode(vm.parseJson(json, key), (uint256[]));
}

function readInt(string memory json, string memory key) internal returns (int256) {
function readInt(string memory json, string memory key) internal pure returns (int256) {
return abi.decode(vm.parseJson(json, key), (int256));
}

function readIntArray(string memory json, string memory key) internal returns (int256[] memory) {
function readIntArray(string memory json, string memory key) internal pure returns (int256[] memory) {
return abi.decode(vm.parseJson(json, key), (int256[]));
}

function readBytes32(string memory json, string memory key) internal returns (bytes32) {
function readBytes32(string memory json, string memory key) internal pure returns (bytes32) {
return abi.decode(vm.parseJson(json, key), (bytes32));
}

function readBytes32Array(string memory json, string memory key) internal returns (bytes32[] memory) {
function readBytes32Array(string memory json, string memory key) internal pure returns (bytes32[] memory) {
return abi.decode(vm.parseJson(json, key), (bytes32[]));
}

function readString(string memory json, string memory key) internal returns (string memory) {
function readString(string memory json, string memory key) internal pure returns (string memory) {
return abi.decode(vm.parseJson(json, key), (string));
}

function readStringArray(string memory json, string memory key) internal returns (string[] memory) {
function readStringArray(string memory json, string memory key) internal pure returns (string[] memory) {
return abi.decode(vm.parseJson(json, key), (string[]));
}

function readAddress(string memory json, string memory key) internal returns (address) {
function readAddress(string memory json, string memory key) internal pure returns (address) {
return abi.decode(vm.parseJson(json, key), (address));
}

function readAddressArray(string memory json, string memory key) internal returns (address[] memory) {
function readAddressArray(string memory json, string memory key) internal pure returns (address[] memory) {
return abi.decode(vm.parseJson(json, key), (address[]));
}

function readBool(string memory json, string memory key) internal returns (bool) {
function readBool(string memory json, string memory key) internal pure returns (bool) {
return abi.decode(vm.parseJson(json, key), (bool));
}

function readBoolArray(string memory json, string memory key) internal returns (bool[] memory) {
function readBoolArray(string memory json, string memory key) internal pure returns (bool[] memory) {
return abi.decode(vm.parseJson(json, key), (bool[]));
}

function readBytes(string memory json, string memory key) internal returns (bytes memory) {
function readBytes(string memory json, string memory key) internal pure returns (bytes memory) {
return abi.decode(vm.parseJson(json, key), (bytes));
}

function readBytesArray(string memory json, string memory key) internal returns (bytes[] memory) {
function readBytesArray(string memory json, string memory key) internal pure returns (bytes[] memory) {
return abi.decode(vm.parseJson(json, key), (bytes[]));
}
}
2 changes: 1 addition & 1 deletion src/Test.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity >=0.6.2 <0.9.0;

import {CommonBase} from "./Common.sol";
import "../lib/ds-test/src/test.sol";
import "ds-test/test.sol";
// forgefmt: disable-next-line
import {console, console2, StdAssertions, StdCheats, stdError, stdJson, stdMath, StdStorage, stdStorage, StdUtils, Vm} from "./Components.sol";

Expand Down