mirror of
https://codeberg.org/wownero/wownero-lws
synced 2026-01-09 23:25:16 -08:00
Added unit tests, and fixed two bugs: (#53)
* Integer conversion checks in src/wire/read.h * Missing "boolean" function in wire::writer and derived types
This commit is contained in:
committed by
Lee *!* Clagett
parent
d233c72b5e
commit
c958ac7963
@@ -165,7 +165,7 @@ namespace lws
|
||||
|
||||
void rpc::read_bytes(wire::json_reader& source, safe_uint64& self)
|
||||
{
|
||||
self = safe_uint64(wire::integer::convert_to<std::uint64_t>(source.safe_unsigned_integer()));
|
||||
self = safe_uint64(wire::integer::cast_unsigned<std::uint64_t>(source.safe_unsigned_integer()));
|
||||
}
|
||||
void rpc::write_bytes(wire::json_writer& dest, const safe_uint64 self)
|
||||
{
|
||||
@@ -175,7 +175,7 @@ namespace lws
|
||||
void rpc::read_bytes(wire::json_reader& source, safe_uint64_array& self)
|
||||
{
|
||||
for (std::size_t count = source.start_array(); !source.is_array_end(count); --count)
|
||||
self.values.emplace_back(wire::integer::convert_to<std::uint64_t>(source.safe_unsigned_integer()));
|
||||
self.values.emplace_back(wire::integer::cast_unsigned<std::uint64_t>(source.safe_unsigned_integer()));
|
||||
source.end_array();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user