pass std::string("...") to addJsonMember()

This commit is contained in:
woodser
2020-12-20 13:40:18 -05:00
parent ff19218059
commit 2e60b751a3
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -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 <class T>
void addJsonMember(std::string key, T val, rapidjson::Document::AllocatorType& allocator, rapidjson::Value& root, rapidjson::Value& field) {
+1 -1
View File
@@ -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;