defined serialize utils

This commit is contained in:
woodser
2019-06-04 11:42:20 -04:00
parent 377d9b4eb5
commit 665b8a862b
2 changed files with 20 additions and 9 deletions
+8 -7
View File
@@ -74,13 +74,14 @@ void MoneroUtils::binaryBlocksToJson(const std::string &bin, std::string &json)
json = ss.str();
}
string MoneroUtils::serialize(vector<MoneroBlock> blocks) {
cout << "serialize(blocks)" << endl;
throw runtime_error("Not implemented");
string MoneroUtils::serialize(const MoneroAccount& account) {
throw runtime_error("serialize(account) not implemented");
}
MoneroTxRequest MoneroUtils::deserialize(const string& txRequestStr) {
cout << "deserialize(txRequestStr)" << endl;
cout << txRequestStr << endl;
throw runtime_error("Not implemented");
string MoneroUtils::serialize(const MoneroSubaddress& subaddress) {
throw runtime_error("serialize(subaddress) not implemented");
}
string MoneroUtils::serialize(const MoneroBlock& block) {
throw runtime_error("serialize(block) not implemented");
}
+12 -2
View File
@@ -21,12 +21,22 @@ namespace MoneroUtils
void binaryBlocksToJson(const std::string &bin, std::string &json);
string serialize(const vector<MoneroBlock> blocks);
// TODO: template implementation here, could move to MoneroUtils.hpp per https://stackoverflow.com/questions/3040480/c-template-function-compiles-in-header-but-not-implementation
template <class T> string serialize(const vector<T> types) {
cout << "serialize(types)" << endl;
throw runtime_error("Not implemented");
}
MoneroTxRequest deserialize(const string& txRequestStr);
string serialize(const MoneroAccount& account);
string serialize(const MoneroSubaddress& subaddress);
string serialize(const MoneroBlock& block);
/**
* Modified from core_rpc_server.cpp to return a string.
*
* TODO: remove this duplicate, use core_rpc_server instead
*/
static std::string get_pruned_tx_json(cryptonote::transaction &tx)
{