Skip to content

Commit

Permalink
fix: trim whitespace from ffi output before decoding it (gakonst#563)
Browse files Browse the repository at this point in the history
  • Loading branch information
mds1 authored Jan 24, 2022
1 parent 4b4745c commit 6c1a4e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion evm-adapters/src/sputnik/cheatcodes/cheatcode_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ impl<'a, 'b, B: Backend, P: PrecompileSet> CheatcodeStackExecutor<'a, 'b, B, P>

// get the hex string & decode it
let output = unsafe { std::str::from_utf8_unchecked(&output) };
let decoded = match hex::decode(&output[2..]) {
let decoded = match hex::decode(&output.trim()[2..]) {
Ok(res) => res,
Err(err) => return evm_error(&err.to_string()),
};
Expand Down

0 comments on commit 6c1a4e3

Please sign in to comment.