Skip to content

Commit 2a2ce36

Browse files
authored
feat: add cheats to read/write binary files (#189)
1 parent cb69e9c commit 2a2ce36

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Vm.sol

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,18 @@ interface Vm {
119119

120120
// Reads the entire content of file to string, (path) => (data)
121121
function readFile(string calldata) external returns (string memory);
122+
// Reads the entire content of file as binary. Path is relative to the project root. (path) => (data)
123+
function readFileBinary(string calldata) external returns (bytes memory);
122124
// Get the path of the current project root
123125
function projectRoot() external returns (string memory);
124126
// Reads next line of file to string, (path) => (line)
125127
function readLine(string calldata) external returns (string memory);
126128
// Writes data to file, creating a file if it does not exist, and entirely replacing its contents if it does.
127129
// (path, data) => ()
128130
function writeFile(string calldata, string calldata) external;
131+
// Writes binary data to a file, creating a file if it does not exist, and entirely replacing its contents if it does.
132+
// Path is relative to the project root. (path, data) => ()
133+
function writeFileBinary(string calldata, bytes calldata) external;
129134
// Writes line to file, creating a file if it does not exist.
130135
// (path, data) => ()
131136
function writeLine(string calldata, string calldata) external;

0 commit comments

Comments
 (0)