mirror of
https://github.com/monero-project/monero.git
synced 2025-11-30 20:17:03 -05:00
Various improvements to the ZMQ JSON-RPC handling:
- Finding handling function in ZMQ JSON-RPC now uses binary search
- Temporary `std::vector`s in JSON output now use `epee::span` to
prevent allocations.
- Binary -> hex in JSON output no longer allocates temporary buffer
- C++ structs -> JSON skips intermediate DOM creation, and instead
write directly to an output stream.
This commit is contained in:
parent
b4e1dc83d2
commit
0f78b06e8c
12 changed files with 832 additions and 1029 deletions
|
|
@ -850,6 +850,17 @@ TEST(ToHex, Array)
|
|||
);
|
||||
}
|
||||
|
||||
TEST(ToHex, ArrayFromPod)
|
||||
{
|
||||
std::array<char, 64> expected{{'5', 'f', '2', 'b', '0', '1'}};
|
||||
std::fill(expected.begin() + 6, expected.end(), '0');
|
||||
|
||||
EXPECT_EQ(
|
||||
expected,
|
||||
(epee::to_hex::array(crypto::ec_point{{0x5F, 0x2B, 0x01, 0x00}}))
|
||||
);
|
||||
}
|
||||
|
||||
TEST(ToHex, Ostream)
|
||||
{
|
||||
std::stringstream out;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue