output and key image impl

This commit is contained in:
woodser
2019-06-21 18:28:56 -04:00
parent f3c095ae6a
commit b27d7af8f1
2 changed files with 23 additions and 11 deletions
+21 -10
View File
@@ -280,13 +280,31 @@ namespace monero {
}
}
// --------------------------- MONERO KEY IMAGE -----------------------------
boost::property_tree::ptree MoneroKeyImage::toPropertyTree() const {
//cout << "MoneroKeyImage::toPropertyTree(tx)" << endl;
boost::property_tree::ptree node;
if (hex != boost::none) node.put("hex", *hex);
if (signature != boost::none) node.put("signature", *signature);
return node;
}
void MoneroKeyImage::merge(const shared_ptr<MoneroKeyImage>& self, const shared_ptr<MoneroKeyImage>& other) {
cout << "MoneroKeyImage::merge()" << endl;
throw runtime_error("Not implemented");
}
// ------------------------------ MONERO OUTPUT -----------------------------
boost::property_tree::ptree MoneroOutput::toPropertyTree() const {
//cout << "MoneroOutput::txToPropertyTree(tx)" << endl;
//cout << "MoneroOutput::toPropertyTree(tx)" << endl;
boost::property_tree::ptree node;
//if (id != boost::none) node.put("id", *id); TODO
throw runtime_error("MoneroOutput toPropertyTree() not implemented");
if (keyImage != boost::none) node.add_child("keyImage", (*keyImage)->toPropertyTree());
if (amount != boost::none) node.put("amount", *amount);
if (index != boost::none) node.put("index", *index);
if (!ringOutputIndices.empty()) throw runtime_error("MoneroOutput::toPropertyTree() ringOutputIndices not implemented");
if (stealthPublicKey != boost::none) node.put("stealthPublicKey", *stealthPublicKey);
return node;
}
@@ -294,11 +312,4 @@ namespace monero {
cout << "MoneroOutput::merge()" << endl;
throw runtime_error("Not implemented");
}
// --------------------------- MONERO KEY IMAGE -----------------------------
void MoneroKeyImage::merge(const shared_ptr<MoneroKeyImage>& self, const shared_ptr<MoneroKeyImage>& other) {
cout << "MoneroKeyImage::merge()" << endl;
throw runtime_error("Not implemented");
}
}
+2 -1
View File
@@ -150,10 +150,11 @@ namespace monero {
/**
* Models a Monero key image.
*/
struct MoneroKeyImage {
struct MoneroKeyImage : public SerializableStruct {
boost::optional<string> hex;
boost::optional<string> signature;
boost::property_tree::ptree toPropertyTree() const;
void merge(const shared_ptr<MoneroKeyImage>& self, const shared_ptr<MoneroKeyImage>& other);
};