Skip to content

Commit c4aaed6

Browse files
jrcarlos2000mds1
andauthored
feat: update Vm.sol with tryFfi (#443)
* feat : add tryFii to Vm.sol * chore: name parameters --------- Co-authored-by: Matt Solomon <[email protected]>
1 parent 7742caf commit c4aaed6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Vm.sol

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ interface VmSafe {
5454
uint256 privateKey;
5555
}
5656

57+
struct FfiResult {
58+
int32 exit_code;
59+
bytes stdout;
60+
bytes stderr;
61+
}
62+
5763
// Derives a private key from the name, labels the account with that name, and returns the wallet
5864
function createWallet(string calldata walletLabel) external returns (Wallet memory wallet);
5965
// Generates a wallet from the private key and returns the wallet
@@ -75,6 +81,8 @@ interface VmSafe {
7581
function getNonce(address account) external view returns (uint64 nonce);
7682
// Performs a foreign function call via the terminal
7783
function ffi(string[] calldata commandInput) external returns (bytes memory result);
84+
// Performs a foreign function call via terminal and returns the exit code, stdout, and stderr
85+
function tryFfi(string[] calldata commandInput) external returns (FfiResult memory result);
7886
// Sets environment variables
7987
function setEnv(string calldata name, string calldata value) external;
8088
// Reads environment variables, (name) => (value)

0 commit comments

Comments
 (0)