Add wire::json_writer, and use in some of ZMQ-PUB functions.

This commit is contained in:
Lee *!* Clagett
2026-05-21 17:19:52 -04:00
committed by Lee Clagett
parent fb5b06bd3b
commit 108244cdf5
22 changed files with 1030 additions and 101 deletions
-21
View File
@@ -1532,27 +1532,6 @@ void fromJsonValue(const rapidjson::Value& val, cryptonote::rpc::output_distribu
GET_FROM_JSON_OBJECT(val, dist.data.base, base);
}
void toJsonValue(rapidjson::Writer<epee::byte_stream>& dest, const cryptonote::tx_block_template_backlog_entry& entry)
{
dest.StartObject();
INSERT_INTO_JSON_OBJECT(dest, id, entry.id);
INSERT_INTO_JSON_OBJECT(dest, weight, entry.weight);
INSERT_INTO_JSON_OBJECT(dest, fee, entry.fee);
dest.EndObject();
}
void fromJsonValue(const rapidjson::Value& val, cryptonote::tx_block_template_backlog_entry& entry)
{
if (!val.IsObject())
{
throw WRONG_TYPE("json object");
}
GET_FROM_JSON_OBJECT(val, entry.id, id);
GET_FROM_JSON_OBJECT(val, entry.weight, weight);
GET_FROM_JSON_OBJECT(val, entry.fee, fee);
}
} // namespace json
} // namespace cryptonote