From 52861006f71bd617cb57e7715d20626c89360388 Mon Sep 17 00:00:00 2001 From: woodser Date: Mon, 8 Jul 2019 10:29:18 -0400 Subject: [PATCH] update scratchpad to debug getTxs() --- test/Scratchpad.cpp | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/test/Scratchpad.cpp b/test/Scratchpad.cpp index 39afd67..4eeec2a 100644 --- a/test/Scratchpad.cpp +++ b/test/Scratchpad.cpp @@ -81,11 +81,30 @@ int main(int argc, const char* argv[]) { // if (!*transfer->tx->isConfirmed) throw runtime_error("Transfer should be confirmed"); // } - shared_ptr txRequest = shared_ptr(new MoneroTxRequest()); - txRequest->isConfirmed = true; - vector> txs = wallet->getTxs(*txRequest); +// shared_ptr txRequest = shared_ptr(new MoneroTxRequest()); +// txRequest->isConfirmed = true; +// 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"); +// } + + + // debug simple block merging + vector> txs = wallet->getTxs(); if (txs.empty()) throw runtime_error("Txs should not be empty"); + shared_ptr block = nullptr; for (const shared_ptr& tx : txs) { - if (!*tx->isConfirmed) throw runtime_error("Tx should be confirmed"); + if (tx->getHeight().get() != 360559l) throw runtime_error("Anything other than 360559l should be filtered"); + cout << "We have one!!!" << endl; + if (block == nullptr) block = tx->block.get(); + else { + if (block != tx->block.get()) { + cout << "BOOM" << endl; + cout << block->serialize(); + cout << "--- VS ---" << endl; + cout << tx->block.get()->serialize(); + } + } } }