aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests/json_serialization.cpp
diff options
context:
space:
mode:
authorLee Clagett <code@leeclagett.com>2020-03-18 23:22:39 +0000
committerLee Clagett <code@leeclagett.com>2020-04-11 04:12:11 +0000
commitc26c93019a52dee52ee865f4f1b23e6929968258 (patch)
treee17353bec4084e7c502921eea3169e22b7f125e1 /tests/unit_tests/json_serialization.cpp
parentMerge pull request #6451 (diff)
downloadmonero-c26c93019a52dee52ee865f4f1b23e6929968258.tar.xz
Add byte_stream for zero-copy serialization, and add support in ZMQ-JSON.
Diffstat (limited to 'tests/unit_tests/json_serialization.cpp')
-rw-r--r--tests/unit_tests/json_serialization.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/unit_tests/json_serialization.cpp b/tests/unit_tests/json_serialization.cpp
index 6f98d854d..5873d0ab6 100644
--- a/tests/unit_tests/json_serialization.cpp
+++ b/tests/unit_tests/json_serialization.cpp
@@ -3,10 +3,10 @@
#include <boost/range/adaptor/indexed.hpp>
#include <gtest/gtest.h>
#include <rapidjson/document.h>
-#include <rapidjson/stringbuffer.h>
#include <rapidjson/writer.h>
#include <vector>
+#include "byte_stream.h"
#include "crypto/hash.h"
#include "cryptonote_basic/account.h"
#include "cryptonote_basic/cryptonote_basic.h"
@@ -86,14 +86,14 @@ namespace
template<typename T>
T test_json(const T& value)
{
- rapidjson::StringBuffer buffer;
+ epee::byte_stream buffer;
{
- rapidjson::Writer<rapidjson::StringBuffer> dest{buffer};
+ rapidjson::Writer<epee::byte_stream> dest{buffer};
cryptonote::json::toJsonValue(dest, value);
}
rapidjson::Document doc;
- doc.Parse(buffer.GetString());
+ doc.Parse(reinterpret_cast<const char*>(buffer.data()), buffer.size());
if (doc.HasParseError() || !doc.IsObject())
{
throw cryptonote::json::PARSE_FAIL();