forked from such-gitea/wownero-lws
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
@@ -47,6 +47,8 @@ namespace wire
|
||||
|
||||
virtual ~writer() noexcept;
|
||||
|
||||
virtual void boolean(bool) = 0;
|
||||
|
||||
virtual void integer(int) = 0;
|
||||
virtual void integer(std::intmax_t) = 0;
|
||||
|
||||
@@ -78,6 +80,11 @@ namespace wire
|
||||
|
||||
// leave in header, compiler can de-virtualize when final type is given
|
||||
|
||||
inline void write_bytes(writer& dest, const bool source)
|
||||
{
|
||||
dest.boolean(source);
|
||||
}
|
||||
|
||||
inline void write_bytes(writer& dest, const int source)
|
||||
{
|
||||
dest.integer(source);
|
||||
|
||||
Reference in New Issue
Block a user