File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ struct define_map_imp {
3939 convert_helper (*it->second , std::get<N-1 >(t));
4040 } else {
4141 // <barretenberg>
42- throw msgpack::unpack_error (std::string (" Missing field " + std::get<N-2 >(t) ));
42+ throw msgpack::unpack_error (std::string (" Missing field " ) + std::get<N-2 >(t));
4343 // </barretenberg>
4444 }
4545 }
Original file line number Diff line number Diff line change @@ -466,8 +466,14 @@ struct object_stringize_visitor {
466466 m_os << ' "' ;
467467 return true ;
468468 }
469- bool visit_bin (const char * /* v*/ , uint32_t size) {
470- m_os << " \" BIN(size:" << size << " )\" " ;
469+ bool visit_bin (const char * v, uint32_t size) {
470+ // <barretenberg> print binary strings in hex
471+ m_os << " \" BIN(size:" << size << " ): 0x" ;
472+ for (uint32_t i = 0 ; i < size; ++i) {
473+ m_os << std::hex << std::setw (2 ) << std::setfill (' 0' ) << static_cast <int >(static_cast <unsigned char >(v[i]));
474+ }
475+ m_os << " \" " ;
476+ // </barrenteberg>
471477 return true ;
472478 }
473479 bool visit_ext (const char * v, uint32_t size) {
@@ -633,6 +639,8 @@ namespace detail {
633639template <typename Stream, typename T>
634640struct packer_serializer {
635641 static msgpack::packer<Stream>& pack (msgpack::packer<Stream>& o, const T& v) {
642+ // <barretenberg>Note, if this is failing, the associated type probably wants
643+ // an auto msgpack(){ar(NVP(...fields...));} method</barretenberg>
636644 v.msgpack_pack (o);
637645 return o;
638646 }
You can’t perform that action at this time.
0 commit comments