mirror of
https://github.com/wownero/wownero-cpp.git
synced 2026-10-21 00:58:41 +02:00
defined tx/WalletToPropertyTree() to re-serialize given tx request
This commit is contained in:
@@ -145,3 +145,36 @@ boost::property_tree::ptree MoneroUtils::toPropertyTree(const MoneroSubaddress&
|
||||
if (subaddress.numBlocksToUnlock != nullptr) subaddressNode.put("numBlocksToUnlock", *subaddress.numBlocksToUnlock);
|
||||
return subaddressNode;
|
||||
}
|
||||
|
||||
// blockToPropertyTree
|
||||
|
||||
boost::property_tree::ptree MoneroUtils::txToPropertyTree(const MoneroTx& tx) {
|
||||
cout << "txToPropertyTree(tx)" << endl;
|
||||
boost::property_tree::ptree txNode;
|
||||
if (tx.id != nullptr) txNode.put("id", *tx.id);
|
||||
// if (subaddress.accountIndex != nullptr) subaddressNode.put("accountIndex", *subaddress.accountIndex);
|
||||
// if (subaddress.index != nullptr) subaddressNode.put("index", *subaddress.index);
|
||||
// if (subaddress.address != nullptr) subaddressNode.put("address", *subaddress.address);
|
||||
// if (subaddress.label != nullptr) subaddressNode.put("label", *subaddress.label);
|
||||
// if (subaddress.balance != nullptr) subaddressNode.put("balance", *subaddress.balance);
|
||||
// if (subaddress.unlockedBalance != nullptr) subaddressNode.put("unlockedBalance", *subaddress.unlockedBalance);
|
||||
// if (subaddress.numUnspentOutputs != nullptr) subaddressNode.put("numUnspentOutputs", *subaddress.numUnspentOutputs);
|
||||
// if (subaddress.isUsed != nullptr) subaddressNode.put("isUsed", *subaddress.isUsed);
|
||||
// if (subaddress.numBlocksToUnlock != nullptr) subaddressNode.put("numBlocksToUnlock", *subaddress.numBlocksToUnlock);
|
||||
return txNode;
|
||||
}
|
||||
|
||||
boost::property_tree::ptree MoneroUtils::txWalletToPropertyTree(const MoneroTxWallet& tx) {
|
||||
cout << "txWalletToPropertyTree(tx)" << endl;
|
||||
boost::property_tree::ptree txNode = txToPropertyTree(tx);
|
||||
// if (subaddress.accountIndex != nullptr) subaddressNode.put("accountIndex", *subaddress.accountIndex);
|
||||
// if (subaddress.index != nullptr) subaddressNode.put("index", *subaddress.index);
|
||||
// if (subaddress.address != nullptr) subaddressNode.put("address", *subaddress.address);
|
||||
// if (subaddress.label != nullptr) subaddressNode.put("label", *subaddress.label);
|
||||
// if (subaddress.balance != nullptr) subaddressNode.put("balance", *subaddress.balance);
|
||||
// if (subaddress.unlockedBalance != nullptr) subaddressNode.put("unlockedBalance", *subaddress.unlockedBalance);
|
||||
// if (subaddress.numUnspentOutputs != nullptr) subaddressNode.put("numUnspentOutputs", *subaddress.numUnspentOutputs);
|
||||
// if (subaddress.isUsed != nullptr) subaddressNode.put("isUsed", *subaddress.isUsed);
|
||||
// if (subaddress.numBlocksToUnlock != nullptr) subaddressNode.put("numBlocksToUnlock", *subaddress.numBlocksToUnlock);
|
||||
return txNode;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user