Commit 2541e99f authored by Mark Tyneway's avatar Mark Tyneway Committed by GitHub

contracts-bedrock: fix commit hash serialization (#10383)

Previous implementation didn't correctly serialize as string
so it came out as unreadable, now we make sure to abi encode
and decode correctly. Enables us to know which commit the code
runs on to help with debugging.
parent f4bd91c8
......@@ -23,7 +23,7 @@ library Executables {
string[] memory commands = new string[](3);
commands[0] = bash;
commands[1] = "-c";
commands[2] = "git rev-parse HEAD";
return string(vm.ffi(commands));
commands[2] = "cast abi-encode 'f(string)' $(git rev-parse HEAD)";
return abi.decode(vm.ffi(commands), (string));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment