mirror of
https://codeberg.org/wownero/wownero-lws
synced 2026-01-11 08:05:16 -08:00
Update ::wire:: to be closer to Monero variant (#70)
This commit is contained in:
committed by
Lee *!* Clagett
parent
3e0555e07d
commit
e1bd9541f1
@@ -37,7 +37,10 @@ namespace lmdb
|
||||
{
|
||||
epee::byte_stream initial;
|
||||
initial.write({reinterpret_cast<const char*>(std::addressof(val1)), sizeof(val1)});
|
||||
return wire_write::to_bytes(wire::msgpack_slice_writer{std::move(initial), true}, val2);
|
||||
|
||||
wire::msgpack_slice_writer dest{std::move(initial), true};
|
||||
wire_write::bytes(dest, val2);
|
||||
return epee::byte_slice{dest.take_sink()};
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -76,10 +79,12 @@ namespace lmdb
|
||||
|
||||
auto msgpack_bytes = lmdb::to_byte_span(value);
|
||||
msgpack_bytes.remove_prefix(sizeof(out.first));
|
||||
auto msgpack = wire::msgpack::from_bytes<msgpack_value_type>(epee::byte_slice{{msgpack_bytes}});
|
||||
if (!msgpack)
|
||||
return msgpack.error();
|
||||
out.second = std::move(*msgpack);
|
||||
|
||||
msgpack_value_type second{};
|
||||
const std::error_code error = wire::msgpack::from_bytes(epee::byte_slice{{msgpack_bytes}}, second);
|
||||
if (error)
|
||||
return error;
|
||||
out.second = std::move(second);
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user