Skip to content

Commit

Permalink
chore: add fsMetadata cheat (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
mds1 committed Dec 4, 2022
1 parent c725d45 commit bd533b5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Vm.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ interface VmSafe {
string url;
}

struct FsMetadata {
bool isDir;
bool isSymlink;
uint256 length;
bool readOnly;
uint256 modified;
uint256 accessed;
uint256 created;
}

// Loads a storage slot from an address (who, slot)
function load(address, bytes32) external view returns (bytes32);
// Signs data, (privateKey, digest) => (v, r, s)
Expand Down Expand Up @@ -95,6 +105,8 @@ interface VmSafe {
function readFileBinary(string calldata) external view returns (bytes memory);
// Get the path of the current project root
function projectRoot() external view returns (string memory);
// Get the metadata for a file/directory
function fsMetadata(string calldata fileOrDir) external returns (FsMetadata memory metadata);
// Reads next line of file to string, (path) => (line)
function readLine(string calldata) external view returns (string memory);
// Writes data to file, creating a file if it does not exist, and entirely replacing its contents if it does.
Expand Down

0 comments on commit bd533b5

Please sign in to comment.