From a3011fd33476e5933af3977cf2e0908d263efe43 Mon Sep 17 00:00:00 2001 From: woodser Date: Mon, 24 Jun 2019 18:03:37 -0400 Subject: [PATCH] scratchpad queries txs --- test/Scratchpad.cpp | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/test/Scratchpad.cpp b/test/Scratchpad.cpp index 19c3102..39afd67 100644 --- a/test/Scratchpad.cpp +++ b/test/Scratchpad.cpp @@ -68,16 +68,24 @@ int main(int argc, const char* argv[]) { //MoneroRpcConnection daemonConnection = MoneroRpcConnection("http://localhost:38083", "", ""); wallet->setDaemonConnection("http://localhost:38081", "", ""); - shared_ptr transferRequest = shared_ptr(new MoneroTransferRequest()); - transferRequest->accountIndex = 0; +// shared_ptr transferRequest = shared_ptr(new MoneroTransferRequest()); +// transferRequest->accountIndex = 0; +// shared_ptr txRequest = shared_ptr(new MoneroTxRequest()); +// txRequest->isConfirmed = true; +// transferRequest->txRequest = txRequest; +// //txRequest->transferRequest = transferRequest; +// vector> transfers = wallet->getTransfers(*transferRequest); +// if (transfers.empty()) throw runtime_error("Transfers should not be empty"); +// for (const shared_ptr& transfer : transfers) { +// if (*transfer->accountIndex != 0) throw runtime_error("Account should be 0"); +// if (!*transfer->tx->isConfirmed) throw runtime_error("Transfer should be confirmed"); +// } + shared_ptr txRequest = shared_ptr(new MoneroTxRequest()); txRequest->isConfirmed = true; - transferRequest->txRequest = txRequest; - //txRequest->transferRequest = transferRequest; - vector> transfers = wallet->getTransfers(*transferRequest); - if (transfers.empty()) throw runtime_error("Transfers should not be empty"); - for (const shared_ptr& transfer : transfers) { - if (*transfer->accountIndex != 0) throw runtime_error("Account should be 0"); - if (!*transfer->tx->isConfirmed) throw runtime_error("Transfer should be confirmed"); + vector> txs = wallet->getTxs(*txRequest); + if (txs.empty()) throw runtime_error("Txs should not be empty"); + for (const shared_ptr& tx : txs) { + if (!*tx->isConfirmed) throw runtime_error("Tx should be confirmed"); } }