mirror of
https://github.com/wownero/wownero.git
synced 2026-11-11 19:03:55 +01:00
Add wire::json_writer, and use in some of ZMQ-PUB functions.
This commit is contained in:
committed by
Lee Clagett
parent
fb5b06bd3b
commit
108244cdf5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user