defined MoneroOutputWallet;

MoneroUtils::deserialize() takes param to deserialize to
This commit is contained in:
woodser
2019-06-04 12:06:57 -04:00
parent b348092151
commit 9564393f95
3 changed files with 33 additions and 9 deletions
+14 -6
View File
@@ -86,14 +86,22 @@ string MoneroUtils::serialize(const MoneroBlock& block) {
throw runtime_error("serialize(block) not implemented");
}
MoneroTx MoneroUtils::deserializeTx(const string& txStr) {
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");
}
MoneroTxWallet MoneroUtils::deserializeTxWallet(const string& txStr) {
throw runtime_error("deserializeTxWallet(txStr) not implemented");
}
MoneroTxRequest MoneroUtils::deserializeTxRequest(const string& txRequestStr) {
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");
}
+7 -3
View File
@@ -33,11 +33,15 @@ namespace MoneroUtils
string serialize(const MoneroBlock& block);
MoneroTx deserializeTx(const string& txStr);
void deserializeTx(const string& txStr, MoneroTx& tx);
MoneroTxWallet deserializeTxWallet(const string& txStr);
void deserializeTxWallet(const string& txStr, MoneroTxWallet& tx);
MoneroTxRequest deserializeTxRequest(const string& txRequestStr);
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.
+12
View File
@@ -90,10 +90,22 @@ namespace monero {
vector<MoneroDestination> destinations;
};
/**
* Models a Monero output with wallet extensions.
*/
struct MoneroOutputWallet : public MoneroOutput {
shared_ptr<uint32_t> accountIndex;
shared_ptr<uint32_t> subaddressIndex;
shared_ptr<bool> isSpent;
shared_ptr<bool> isUnlocked;
shared_ptr<bool> isFrozen;
};
/**
* Models a Monero transaction in the context of a wallet.
*/
struct MoneroTxWallet : public MoneroTx {
vector<MoneroOutputWallet> vouts; // TODO: override vouts with different type?
vector<MoneroIncomingTransfer> incomingTransfers;
shared_ptr<MoneroOutgoingTransfer> outgoingTransfer;
shared_ptr<uint32_t> numSuggestedConfirmations;