mirror of
https://github.com/wownero/wownero-cpp.git
synced 2026-10-28 11:38:33 +01:00
testGetTxsWithConfiguration() passing;
implement model copies (wip)
This commit is contained in:
@@ -409,6 +409,13 @@ namespace monero {
|
||||
|
||||
// --------------------------- MONERO KEY IMAGE -----------------------------
|
||||
|
||||
shared_ptr<MoneroKeyImage> MoneroKeyImage::copy(const shared_ptr<MoneroKeyImage>& src, const shared_ptr<MoneroKeyImage>& tgt) const {
|
||||
if (this != src.get()) throw runtime_error("this != src");
|
||||
tgt->hex = src->hex;
|
||||
tgt->signature = src->signature;
|
||||
return tgt;
|
||||
}
|
||||
|
||||
boost::property_tree::ptree MoneroKeyImage::toPropertyTree() const {
|
||||
boost::property_tree::ptree node;
|
||||
if (hex != boost::none) node.put("hex", *hex);
|
||||
@@ -423,7 +430,14 @@ namespace monero {
|
||||
// ------------------------------ MONERO OUTPUT -----------------------------
|
||||
|
||||
shared_ptr<MoneroOutput> MoneroOutput::copy(const shared_ptr<MoneroOutput>& src, const shared_ptr<MoneroOutput>& tgt) const {
|
||||
throw runtime_error("MoneroOutput::copy() not implemented");
|
||||
if (this != src.get()) throw runtime_error("this != src");
|
||||
tgt->tx = src->tx; // reference same parent tx by default
|
||||
if (src->keyImage != boost::none) tgt->keyImage = src->keyImage.get()->copy(src->keyImage.get(), make_shared<MoneroKeyImage>());
|
||||
tgt->amount = src->amount;
|
||||
tgt->index = src->index;
|
||||
if (!src->ringOutputIndices.empty()) tgt->ringOutputIndices = vector<uint32_t>(src->ringOutputIndices);
|
||||
tgt->stealthPublicKey = src->stealthPublicKey;
|
||||
return tgt;
|
||||
}
|
||||
|
||||
boost::property_tree::ptree MoneroOutput::toPropertyTree() const {
|
||||
|
||||
@@ -205,6 +205,7 @@ namespace monero {
|
||||
boost::optional<string> hex;
|
||||
boost::optional<string> signature;
|
||||
|
||||
shared_ptr<MoneroKeyImage> copy(const shared_ptr<MoneroKeyImage>& src, const shared_ptr<MoneroKeyImage>& tgt) const;
|
||||
boost::property_tree::ptree toPropertyTree() const;
|
||||
void merge(const shared_ptr<MoneroKeyImage>& self, const shared_ptr<MoneroKeyImage>& other);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user