define MoneroKeyImageImportResult and importKeyImages()

This commit is contained in:
woodser
2019-07-01 12:05:20 -04:00
parent ebd74ddf7d
commit 75fcc8244f
4 changed files with 35 additions and 9 deletions
+5
View File
@@ -1089,6 +1089,11 @@ namespace monero {
return keyImages;
}
shared_ptr<MoneroKeyImageImportResult> MoneroWallet::importKeyImages(const vector<MoneroKeyImage>& keyImages) {
cout << "MoneroWalelt::importKeyImages()" << endl;
throw runtime_error("Not implemented");
}
vector<shared_ptr<MoneroTxWallet>> MoneroWallet::sendSplit(const MoneroSendRequest& request) {
cout << "MoneroWallet::sendSplit(request)" << endl;
cout << "MoneroSendRequest: " << request.serialize() << endl;
+8 -8
View File
@@ -582,14 +582,14 @@ namespace monero {
*/
vector<shared_ptr<MoneroKeyImage>> getKeyImages() const;
// /**
// * Import signed key images and verify their spent status.
// *
// * @param keyImages are key images to import and verify (requires hex and signature)
// * @return results of the import
// */
// public MoneroKeyImageImportResult importKeyImages(List<MoneroKeyImage> keyImages);
//
/**
* Import signed key images and verify their spent status.
*
* @param keyImages are key images to import and verify (requires hex and signature)
* @return results of the import
*/
shared_ptr<MoneroKeyImageImportResult> importKeyImages(const vector<MoneroKeyImage>& keyImages);
// /**
// * Get new key images from the last imported outputs.
// *
+11 -1
View File
@@ -389,7 +389,7 @@ namespace monero {
return node;
}
// -------------------------- MONERO INTEGRATED ADDRESS -----------------------------
// ---------------------- MONERO INTEGRATED ADDRESS -------------------------
boost::property_tree::ptree MoneroIntegratedAddress::toPropertyTree() const {
boost::property_tree::ptree node;
@@ -398,4 +398,14 @@ namespace monero {
node.put("integratedAddress", integratedAddress);
return node;
}
// -------------------- MONERO KEY IMAGE IMPORT RESULT ----------------------
boost::property_tree::ptree MoneroKeyImageImportResult::toPropertyTree() const {
boost::property_tree::ptree node;
if (height != boost::none) node.put("height", *height);
if (spentAmount != boost::none) node.put("spentAmount", *spentAmount);
if (unspentAmount != boost::none) node.put("unspentAmount", *unspentAmount);
return node;
}
}
+11
View File
@@ -254,4 +254,15 @@ namespace monero {
boost::property_tree::ptree toPropertyTree() const;
};
/**
* Models results from importing key images.
*/
struct MoneroKeyImageImportResult : public SerializableStruct {
boost::optional<uint64_t> height;
boost::optional<uint64_t> spentAmount;
boost::optional<uint64_t> unspentAmount;
boost::property_tree::ptree toPropertyTree() const;
};
}