mirror of
https://github.com/wownero/wownero-cpp.git
synced 2026-12-02 05:04:04 +01:00
cleanup
This commit is contained in:
+39
-33
@@ -2,8 +2,6 @@
|
||||
#include "rpc/core_rpc_server_commands_defs.h"
|
||||
#include "storages/portable_storage_template_helper.h"
|
||||
#include "cryptonote_basic/cryptonote_format_utils.h"
|
||||
#include <boost/property_tree/ptree.hpp>
|
||||
#include <boost/property_tree/json_parser.hpp>
|
||||
|
||||
using namespace std;
|
||||
using namespace boost;
|
||||
@@ -74,34 +72,42 @@ void MoneroUtils::binaryBlocksToJson(const std::string &bin, std::string &json)
|
||||
json = ss.str();
|
||||
}
|
||||
|
||||
string MoneroUtils::serialize(const MoneroAccount& account) {
|
||||
throw runtime_error("serialize(account) 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");
|
||||
}
|
||||
|
||||
void MoneroUtils::deserializeTx(const string& txStr, MoneroTx& tx) {
|
||||
throw runtime_error("deserializeTx(txStr) not implemented");
|
||||
}
|
||||
|
||||
void MoneroUtils::deserializeTxWallet(const string& txStr, MoneroTxWallet& tx) {
|
||||
throw runtime_error("deserializeTxWallet(txStr) not implemented");
|
||||
}
|
||||
|
||||
void MoneroUtils::deserializeTxRequest(const string& txRequestStr, MoneroTxRequest& request) {
|
||||
throw runtime_error("deserializeTxRequest(txRequestStr) not implemented");
|
||||
}
|
||||
|
||||
void MoneroUtils::deserializeOutput(const string& outputStr, MoneroOutput& output) {
|
||||
throw runtime_error("deserializeOutput(outputStr) not implemented");
|
||||
}
|
||||
|
||||
void MoneroUtils::deserializeOutputWallet(const string& outputStr, MoneroOutputWallet& output) {
|
||||
throw runtime_error("deserializeOutputWallet(outputStr) not implemented");
|
||||
}
|
||||
//string MoneroUtils::serialize(const MoneroAccount& account) {
|
||||
//
|
||||
// // build property tree from account
|
||||
// boost::property_tree::ptree accountNode;
|
||||
// addNode(accountNode, string("index"), account.index);
|
||||
//
|
||||
// // convert root to string
|
||||
// std::stringstream ss;
|
||||
// boost::property_tree::write_json(ss, accountNode, false);
|
||||
// return ss.str();
|
||||
//}
|
||||
//
|
||||
//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");
|
||||
//}
|
||||
//
|
||||
//void MoneroUtils::deserializeTx(const string& txStr, MoneroTx& tx) {
|
||||
// throw runtime_error("deserializeTx(txStr) not implemented");
|
||||
//}
|
||||
//
|
||||
//void MoneroUtils::deserializeTxWallet(const string& txStr, MoneroTxWallet& tx) {
|
||||
// throw runtime_error("deserializeTxWallet(txStr) not implemented");
|
||||
//}
|
||||
//
|
||||
//void MoneroUtils::deserializeTxRequest(const string& txRequestStr, MoneroTxRequest& request) {
|
||||
// throw runtime_error("deserializeTxRequest(txRequestStr) not implemented");
|
||||
//}
|
||||
//
|
||||
//void MoneroUtils::deserializeOutput(const string& outputStr, MoneroOutput& output) {
|
||||
// throw runtime_error("deserializeOutput(outputStr) not implemented");
|
||||
//}
|
||||
//
|
||||
//void MoneroUtils::deserializeOutputWallet(const string& outputStr, MoneroOutputWallet& output) {
|
||||
// throw runtime_error("deserializeOutputWallet(outputStr) not implemented");
|
||||
//}
|
||||
|
||||
+28
-21
@@ -5,6 +5,8 @@
|
||||
#include "cryptonote_basic/cryptonote_basic.h"
|
||||
#include "serialization/keyvalue_serialization.h" // TODO: consolidate with other binary deps?
|
||||
#include "storages/portable_storage.h"
|
||||
#include <boost/property_tree/ptree.hpp>
|
||||
#include <boost/property_tree/json_parser.hpp>
|
||||
|
||||
/**
|
||||
* Collection of utilities for working with Monero's binary portable storage format.
|
||||
@@ -21,27 +23,32 @@ namespace MoneroUtils
|
||||
|
||||
void binaryBlocksToJson(const std::string &bin, std::string &json);
|
||||
|
||||
// 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");
|
||||
}
|
||||
|
||||
string serialize(const MoneroAccount& account);
|
||||
|
||||
string serialize(const MoneroSubaddress& subaddress);
|
||||
|
||||
string serialize(const MoneroBlock& block);
|
||||
|
||||
void deserializeTx(const string& txStr, MoneroTx& tx);
|
||||
|
||||
void deserializeTxWallet(const string& txStr, MoneroTxWallet& tx);
|
||||
|
||||
void deserializeTxRequest(const string& txRequestStr, MoneroTxRequest& request);
|
||||
|
||||
void deserializeOutput(const string& outputStr, MoneroOutput& output);
|
||||
|
||||
void deserializeOutputWallet(const string& outputStr, MoneroOutputWallet& output);
|
||||
// // 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");
|
||||
// }
|
||||
//
|
||||
// void addNode(boost::property_tree::ptree root, const string& key, shared_ptr<void> ptr) {
|
||||
// cout << "addNode(...)" << endl;
|
||||
// throw runtime_error("Not implemented");
|
||||
// }
|
||||
//
|
||||
// string serialize(const MoneroAccount& account);
|
||||
//
|
||||
// string serialize(const MoneroSubaddress& subaddress);
|
||||
//
|
||||
// string serialize(const MoneroBlock& block);
|
||||
//
|
||||
// void deserializeTx(const string& txStr, MoneroTx& tx);
|
||||
//
|
||||
// void deserializeTxWallet(const string& txStr, MoneroTxWallet& tx);
|
||||
//
|
||||
// void deserializeTxRequest(const string& txRequestStr, MoneroTxRequest& request);
|
||||
//
|
||||
// void deserializeOutput(const string& outputStr, MoneroOutput& output);
|
||||
//
|
||||
// void deserializeOutputWallet(const string& outputStr, MoneroOutputWallet& output);
|
||||
|
||||
/**
|
||||
* Modified from core_rpc_server.cpp to return a string.
|
||||
|
||||
Reference in New Issue
Block a user