Skip to content

Commit 882ebfc

Browse files
committed
Strip whitespace from FFI responses
Fixes #1129
1 parent 344bcfe commit 882ebfc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/Echidna/Exec.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ execTxWith executeTx tx = do
160160
let process = (P.proc cmd args) { P.env = Just mergedEnv }
161161
(_, stdout, _) <- liftIO $ P.readCreateProcessWithExitCode process ""
162162
let encodedResponse = encodeAbiValue $
163-
AbiTuple (V.fromList [AbiBytesDynamic . hexText . T.pack $ stdout])
163+
AbiTuple (V.fromList [AbiBytesDynamic . hexText . T.strip . T.pack $ stdout])
164164
fromEVM (continuation encodedResponse)
165165
runFully
166166

tests/solidity/cheat/ffi.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ contract TestFFI {
1414
inputs[0] = "sh";
1515
inputs[1] = "-c";
1616
// ABI encoded "gm", as a string
17-
inputs[2] = "printf '%s' '0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002676d000000000000000000000000000000000000000000000000000000000000'";
17+
inputs[2] = "echo '0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002676d000000000000000000000000000000000000000000000000000000000000'";
1818

1919
bytes memory res = Hevm(HEVM_ADDRESS).ffi(inputs);
2020

0 commit comments

Comments
 (0)