From 2e60b751a390d22a1401532333b396f9810d8b07 Mon Sep 17 00:00:00 2001 From: woodser Date: Sun, 20 Dec 2020 13:40:18 -0500 Subject: [PATCH] pass std::string("...") to addJsonMember() --- src/utils/monero_utils.h | 2 ++ src/wallet/monero_wallet_model.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/monero_utils.h b/src/utils/monero_utils.h index 8308262..8408510 100644 --- a/src/utils/monero_utils.h +++ b/src/utils/monero_utils.h @@ -83,6 +83,8 @@ namespace monero_utils /** * Add number, string, and boolean json members using template specialization. + * + * TODO: addJsonMember("key", "val", ...) treated as integer instead of string literal */ template void addJsonMember(std::string key, T val, rapidjson::Document::AllocatorType& allocator, rapidjson::Value& root, rapidjson::Value& field) { diff --git a/src/wallet/monero_wallet_model.cpp b/src/wallet/monero_wallet_model.cpp index 71678d9..cec5537 100644 --- a/src/wallet/monero_wallet_model.cpp +++ b/src/wallet/monero_wallet_model.cpp @@ -1285,7 +1285,7 @@ namespace monero { // set string values rapidjson::Value value_str(rapidjson::kStringType); - monero_utils::addJsonMember("signatureType", m_signature_type == monero_message_signature_type::SIGN_WITH_SPEND_KEY ? "spend" : "view", allocator, root, value_str); + monero_utils::addJsonMember("signatureType", m_signature_type == monero_message_signature_type::SIGN_WITH_SPEND_KEY ? std::string("spend") : std::string("view"), allocator, root, value_str); // return root return root;