diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/AvmMini_opcode.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/AvmMini_opcode.cpp index 6c530a765b1..5ebc445ee9b 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/AvmMini_opcode.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/AvmMini_opcode.cpp @@ -1,7 +1,8 @@ #include "AvmMini_opcode.hpp" #include -#include +#include +#include namespace avm_trace { @@ -154,7 +155,10 @@ bool Bytecode::has_in_tag(OpCode const op_code) std::string to_hex(OpCode opcode) { - return std::format("{:02x}", static_cast(opcode)); + std::ostringstream stream; + // pad with 0s to fill exactly 2 hex characters + stream << std::setfill('0') << std::setw(2) << std::hex << (static_cast(opcode) & 0xFF); + return stream.str(); } } // namespace avm_trace \ No newline at end of file